<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>visNetwork</title>
<script src="data:application/x-javascript;base64,KGZ1bmN0aW9uKCkgewogIC8vIElmIHdpbmRvdy5IVE1MV2lkZ2V0cyBpcyBhbHJlYWR5IGRlZmluZWQsIHRoZW4gdXNlIGl0OyBvdGhlcndpc2UgY3JlYXRlIGEKICAvLyBuZXcgb2JqZWN0LiBUaGlzIGFsbG93cyBwcmVjZWRpbmcgY29kZSB0byBzZXQgb3B0aW9ucyB0aGF0IGFmZmVjdCB0aGUKICAvLyBpbml0aWFsaXphdGlvbiBwcm9jZXNzICh0aG91Z2ggbm9uZSBjdXJyZW50bHkgZXhpc3QpLgogIHdpbmRvdy5IVE1MV2lkZ2V0cyA9IHdpbmRvdy5IVE1MV2lkZ2V0cyB8fCB7fTsKCiAgLy8gU2VlIGlmIHdlJ3JlIHJ1bm5pbmcgaW4gYSB2aWV3ZXIgcGFuZS4gSWYgbm90LCB3ZSdyZSBpbiBhIHdlYiBicm93c2VyLgogIHZhciB2aWV3ZXJNb2RlID0gd2luZG93LkhUTUxXaWRnZXRzLnZpZXdlck1vZGUgPQogICAgICAvXGJ2aWV3ZXJfcGFuZT0xXGIvLnRlc3Qod2luZG93LmxvY2F0aW9uKTsKCiAgLy8gU2VlIGlmIHdlJ3JlIHJ1bm5pbmcgaW4gU2hpbnkgbW9kZS4gSWYgbm90LCBpdCdzIGEgc3RhdGljIGRvY3VtZW50LgogIC8vIE5vdGUgdGhhdCBzdGF0aWMgd2lkZ2V0cyBjYW4gYXBwZWFyIGluIGJvdGggU2hpbnkgYW5kIHN0YXRpYyBtb2RlcywgYnV0CiAgLy8gb2J2aW91c2x5LCBTaGlueSB3aWRnZXRzIGNhbiBvbmx5IGFwcGVhciBpbiBTaGlueSBhcHBzL2RvY3VtZW50cy4KICB2YXIgc2hpbnlNb2RlID0gd2luZG93LkhUTUxXaWRnZXRzLnNoaW55TW9kZSA9CiAgICAgIHR5cGVvZih3aW5kb3cuU2hp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rIG11c3QgYmUgYSBmdW5jdGlvbiEgU291cmNlOlxuIiArIHRhc2spOwogICAgICAgIH0KICAgICAgICB0YXNrRnVuYy5hcHBseSh0YXJnZXQsIHRoZXNlQXJncyk7CiAgICAgIH0pOwogICAgfQogIH0KCiAgZnVuY3Rpb24gaW5pdFNpemluZyhlbCkgewogICAgdmFyIHNpemluZyA9IHNpemluZ1BvbGljeShlbCk7CiAgICBpZiAoIXNpemluZykKICAgICAgcmV0dXJuOwoKICAgIHZhciBjZWwgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgiaHRtbHdpZGdldF9jb250YWluZXIiKTsKICAgIGlmICghY2VsKQogICAgICByZXR1cm47CgogICAgaWYgKHR5cGVvZihzaXppbmcucGFkZGluZykgIT09ICJ1bmRlZmluZWQiKSB7CiAgICAgIGRvY3VtZW50LmJvZHkuc3R5bGUubWFyZ2luID0gIjAiOwogICAgICBkb2N1bWVudC5ib2R5LnN0eWxlLnBhZGRpbmcgPSBwYWRkaW5nVG9Dc3ModW5wYWNrUGFkZGluZyhzaXppbmcucGFkZGluZykpOwogICAgfQoKICAgIGlmIChzaXppbmcuZmlsbCkgewogICAgICBkb2N1bWVudC5ib2R5LnN0eWxlLm92ZXJmbG93ID0gImhpZGRlbiI7CiAgICAgIGRvY3VtZW50LmJvZHkuc3R5bGUud2lkdGggPSAiMTAwJSI7CiAgICAgIGRvY3VtZW50LmJvZHkuc3R5bGUuaGVpZ2h0ID0gIjEwMCUiOwogICAgICBkb2N1bWVudC5kb2N1bWVudEVsZW1lbnQuc3R5bGUud2lkdGggPSAiMTAwJSI7CiAgICAgIGRvY3VtZW50LmRvY3VtZW50RWxlbWVudC5zdHlsZS5oZWlnaHQgPSAiMTAwJSI7CiAgICAgIGlmIChjZWwpIHsKICAgICAgICBjZWwuc3R5bGUucG9zaXRpb24gPSAiYWJzb2x1dGUiOwogICAgICAgIHZhciBwYWQgPSB1bnBhY2tQYWRkaW5nKHNpemluZy5wYWRkaW5nKTsKICA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h0IiwgZWwub2Zmc2V0SGVpZ2h0KTsKICAgICAgICAgIGVycm9yRGl2LnRleHQoZXJyLm1lc3NhZ2UpOwogICAgICAgICAgJGVsLmFmdGVyKGVycm9yRGl2KTsKCiAgICAgICAgICAvLyBSZWFsbHkgZHVtYiB3YXkgdG8ga2VlcCB0aGUgc2l6ZS9wb3NpdGlvbiBvZiB0aGUgZXJyb3IgaW4gc3luYyB3aXRoCiAgICAgICAgICAvLyB0aGUgcGFyZW50IGVsZW1lbnQgYXMgdGhlIHdpbmRvdyBpcyByZXNpemVkIG9yIHdoYXRldmVyLgogICAgICAgICAgdmFyIGludElkID0gc2V0SW50ZXJ2YWwoZnVuY3Rpb24oKSB7CiAgICAgICAgICAgIGlmICghZXJyb3JEaXZbMF0ucGFyZW50RWxlbWVudCkgewogICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwoaW50SWQpOwogICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgfQogICAgICAgICAgICBlcnJvckRpdgogICAgICAgICAgICAgIC5jc3MoInRvcCIsIGVsLm9mZnNldFRvcCkKICAgICAgICAgICAgICAuY3NzKCJsZWZ0IiwgZWwub2Zmc2V0TGVmdCkKICAgICAgICAgICAgICAuY3NzKCJtYXhXaWR0aCIsIGVsLm9mZnNldFdpZHRoKQogICAgICAgICAgICAgIC5jc3MoImhlaWdodCIsIGVsLm9mZnNldEhlaWdodCk7CiAgICAgICAgICB9LCA1MDApOwogICAgICAgIH0KICAgICAgfQogICAgfSwKICAgIGNsZWFyRXJyb3I6IGZ1bmN0aW9uKGVsKSB7CiAgICAgIHZhciAkZWwgPSAkKGVsKTsKICAgICAgdmFyIGRpc3BsYXkgPSAkZWwuZGF0YSgicmVzdG9yZS1kaXNwbGF5LW1vZGUiKTsKICAgICAgJGVsLmRhdGEoInJlc3RvcmUtZGlzcGxheS1tb2RlIiwgbnVsbCk7CgogICAgICBpZiAoZGlzcGxheSA9PT0gImlubGluZSIgfHwgZGlzcGxheSA9PT0g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ZG93LkhUTUxXaWRnZXRzLmV2YWx1YXRlU3RyaW5nTWVtYmVyKGRhdGEueCwgZGF0YS5ldmFsc1tpXSk7CiAgICAgICAgfQogICAgICAgIGlmICghYmluZGluZ0RlZi5yZW5kZXJPbk51bGxWYWx1ZSkgewogICAgICAgICAgaWYgKGRhdGEueCA9PT0gbnVsbCkgewogICAgICAgICAgICBlbC5zdHlsZS52aXNpYmlsaXR5ID0gImhpZGRlbiI7CiAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIGVsLnN0eWxlLnZpc2liaWxpdHkgPSAiaW5oZXJpdCI7CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGlmICghZWxlbWVudERhdGEoZWwsICJpbml0aWFsaXplZCIpKSB7CiAgICAgICAgICBpbml0U2l6aW5nKGVsKTsKCiAgICAgICAgICBlbGVtZW50RGF0YShlbCwgImluaXRpYWxpemVkIiwgdHJ1ZSk7CiAgICAgICAgICBpZiAoYmluZGluZ0RlZi5pbml0aWFsaXplKSB7CiAgICAgICAgICAgIHZhciByZXN1bHQgPSBiaW5kaW5nRGVmLmluaXRpYWxpemUoZWwsIGVsLm9mZnNldFdpZHRoLAogICAgICAgICAgICAgIGVsLm9mZnNldEhlaWdodCk7CiAgICAgICAgICAgIGVsZW1lbnREYXRhKGVsLCAiaW5pdF9yZXN1bHQiLCByZXN1bHQpOwogICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBiaW5kaW5nRGVmLnJlbmRlclZhbHVlKGVsLCBkYXRhLngsIGVsZW1lbnREYXRhKGVsLCAiaW5pdF9yZXN1bHQiKSk7CiAgICAgICAgZXZhbEFuZFJ1bihkYXRhLmpzSG9va3MucmVuZGVyLCBlbGVtZW50RGF0YShlbCwgImluaXRfcmVzdWx0IiksIFtlbCwgZGF0YS54XSk7CiAgICAgIH07CgogICAgICAvLyBPbmx5IG92ZXJyaWRlIHJlc2l6ZSBpZiBiaW5kaW5nRGVmIGltcGx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YXIgbGFzdFNpemUgPSB7CiAgICAgICAgICAgIHc6IHNpemVPYmogPyBzaXplT2JqLmdldFdpZHRoKCkgOiBlbC5vZmZzZXRXaWR0aCwKICAgICAgICAgICAgaDogc2l6ZU9iaiA/IHNpemVPYmouZ2V0SGVpZ2h0KCkgOiBlbC5vZmZzZXRIZWlnaHQKICAgICAgICAgIH07CiAgICAgICAgICB2YXIgcmVzaXplSGFuZGxlciA9IGZ1bmN0aW9uKGUpIHsKICAgICAgICAgICAgdmFyIHNpemUgPSB7CiAgICAgICAgICAgICAgdzogc2l6ZU9iaiA/IHNpemVPYmouZ2V0V2lkdGgoKSA6IGVsLm9mZnNldFdpZHRoLAogICAgICAgICAgICAgIGg6IHNpemVPYmogPyBzaXplT2JqLmdldEhlaWdodCgpIDogZWwub2Zmc2V0SGVpZ2h0CiAgICAgICAgICAgIH07CiAgICAgICAgICAgIGlmIChzaXplLncgPT09IDAgJiYgc2l6ZS5oID09PSAwKQogICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgaWYgKHNpemUudyA9PT0gbGFzdFNpemUudyAmJiBzaXplLmggPT09IGxhc3RTaXplLmgpCiAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICBsYXN0U2l6ZSA9IHNpemU7CiAgICAgICAgICAgIGJpbmRpbmcucmVzaXplKGVsLCBzaXplLncsIHNpemUuaCwgaW5pdFJlc3VsdCk7CiAgICAgICAgICB9OwoKICAgICAgICAgIG9uKHdpbmRvdywgInJlc2l6ZSIsIHJlc2l6ZUhhbmRsZXIpOwoKICAgICAgICAgIC8vIFRoaXMgaXMgbmVlZGVkIGZvciBjYXNlcyB3aGVyZSB3ZSdyZSBydW5uaW5nIGluIGEgU2hpbnkKICAgICAgICAgIC8vIGFwcCwgYnV0IHRoZSB3aWRnZXQgaXRzZWxmIGlzIG5vdCBhIFNoaW55IG91dHB1dCwgYnV0CiAgICAgICAgICAvLyByYXRoZXIgYSBzaW1wbGUgc3RhdGljIHdpZGdldC4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FtZTogZGVmbi5uYW1lLAogICAgICB0eXBlOiBkZWZuLnR5cGUsCiAgICAgIGluaXRpYWxpemU6IGZ1bmN0aW9uKGVsLCB3aWR0aCwgaGVpZ2h0KSB7CiAgICAgICAgcmV0dXJuIGRlZm4uZmFjdG9yeShlbCwgd2lkdGgsIGhlaWdodCk7CiAgICAgIH0sCiAgICAgIHJlbmRlclZhbHVlOiBmdW5jdGlvbihlbCwgeCwgaW5zdGFuY2UpIHsKICAgICAgICByZXR1cm4gaW5zdGFuY2UucmVuZGVyVmFsdWUoeCk7CiAgICAgIH0sCiAgICAgIHJlc2l6ZTogZnVuY3Rpb24oZWwsIHdpZHRoLCBoZWlnaHQsIGluc3RhbmNlKSB7CiAgICAgICAgcmV0dXJuIGluc3RhbmNlLnJlc2l6ZSh3aWR0aCwgaGVpZ2h0KTsKICAgICAgfQogICAgfTsKCiAgICBpZiAoZGVmbi5maW5kKQogICAgICByZXN1bHQuZmluZCA9IGRlZm4uZmluZDsKICAgIGlmIChkZWZuLnJlbmRlckVycm9yKQogICAgICByZXN1bHQucmVuZGVyRXJyb3IgPSBkZWZuLnJlbmRlckVycm9yOwogICAgaWYgKGRlZm4uY2xlYXJFcnJvcikKICAgICAgcmVzdWx0LmNsZWFyRXJyb3IgPSBkZWZuLmNsZWFyRXJyb3I7CgogICAgcmV0dXJuIHJlc3VsdDsKICB9Cn0pKCk7Cgo="></script>
<link href="data:text/css;charset=utf-8,%2EclassActivePointer%3Ahover%20%7B%0Acursor%3A%20pointer%3B%0A%7D%0A%0A%2ErPartvisNetwork%7B%0Amargin%3A%200%2E5em%20auto%3B%20%7D%0A%2Evis%20%2Eoverlay%20%7B%0Aposition%3A%20absolute%3B%0Atop%3A%200%3B%0Aleft%3A%200%3B%0Awidth%3A%20100%25%3B%0Aheight%3A%20100%25%3B%0A%0Az%2Dindex%3A%2010%3B%0A%7D%0A%2Evis%2Dactive%20%7B%0Abox%2Dshadow%3A%200%200%2010px%20%2386d5f8%3B%0A%7D%0A%0A%2Evis%20%5Bclass%2A%3D%22span%22%5D%20%7B%0Amin%2Dheight%3A%200%3B%0Awidth%3A%20auto%3B%0A%7D%0Adiv%2Evis%2Dconfiguration%20%7B%0Aposition%3Arelative%3B%0Adisplay%3Ablock%3B%0Afloat%3Aleft%3B%0Afont%2Dsize%3A12px%3B%0A%7D%0Adiv%2Evis%2Dconfiguration%2Dwrapper%20%7B%0Adisplay%3Ablock%3B%0Awidth%3A700px%3B%0A%7D%0Adiv%2Evis%2Dconfiguration%2Dwrapper%3A%3Aafter%20%7B%0Aclear%3A%20both%3B%0Acontent%3A%20%22%22%3B%0Adisplay%3A%20block%3B%0A%7D%0Adiv%2Evis%2Dconfiguration%2Evis%2Dconfig%2Doption%2Dcontainer%7B%0Adisplay%3Ablock%3B%0Awidth%3A495px%3B%0Abackground%2Dcolor%3A%20%23ffffff%3B%0Aborder%3A2px%20solid%20%23f7f8fa%3B%0Aborder%2Dradius%3A4px%3B%0Amargin%2Dtop%3A20px%3B%0Aleft%3A10px%3B%0Apadding%2Dleft%3A5px%3B%0A%7D%0Adiv%2Evis%2Dconfiguration%2Evis%2Dconfig%2Dbutton%7B%0Adisplay%3Ablock%3B%0Awidth%3A495px%3B%0Aheight%3A25px%3B%0Avertical%2Dalign%3A%20middle%3B%0Aline%2Dheight%3A25px%3B%0Abackground%2Dcolor%3A%20%23f7f8fa%3B%0Aborder%3A2px%20solid%20%23ceced0%3B%0Aborder%2Dradius%3A4px%3B%0Amargin%2Dtop%3A20px%3B%0Aleft%3A10px%3B%0Apadding%2Dleft%3A5px%3B%0Acursor%3A%20pointer%3B%0Amargin%2Dbottom%3A30px%3B%0A%7D%0Adiv%2Evis%2Dconfiguration%2Evis%2Dconfig%2Dbutton%2Ehover%7B%0Abackground%2Dcolor%3A%20%234588e6%3B%0Aborder%3A2px%20solid%20%23214373%3B%0Acolor%3A%23ffffff%3B%0A%7D%0Adiv%2Evis%2Dconfiguration%2Evis%2Dconfig%2Ditem%7B%0Adisplay%3Ablock%3B%0Afloat%3Aleft%3B%0Awidth%3A495px%3B%0Aheight%3A25px%3B%0Avertical%2Dalign%3A%20middle%3B%0Aline%2Dheight%3A25px%3B%0A%7D%0Adiv%2Evis%2Dconfiguration%2Evis%2Dconfig%2Ditem%2Evis%2Dconfig%2Ds2%7B%0Aleft%3A10px%3B%0Abackground%2Dcolor%3A%20%23f7f8fa%3B%0Apadding%2Dleft%3A5px%3B%0Aborder%2Dradius%3A3px%3B%0A%7D%0Adiv%2Evis%2Dconfiguration%2Evis%2Dconfig%2Ditem%2Evis%2Dconfig%2Ds3%7B%0Aleft%3A20px%3B%0Abackground%2Dcolor%3A%20%23e4e9f0%3B%0Apadding%2Dleft%3A5px%3B%0Aborder%2Dradius%3A3px%3B%0A%7D%0Adiv%2Evis%2Dconfiguration%2Evis%2Dconfig%2Ditem%2Evis%2Dconfig%2Ds4%7B%0Aleft%3A30px%3B%0Abackground%2Dcolor%3A%20%23cfd8e6%3B%0Apadding%2Dleft%3A5px%3B%0Aborder%2Dradius%3A3px%3B%0A%7D%0Adiv%2Evis%2Dconfiguration%2Evis%2Dconfig%2Dheader%7B%0Afont%2Dsize%3A18px%3B%0Afont%2Dweight%3A%20bold%3B%0A%7D%0Adiv%2Evis%2Dconfiguration%2Evis%2Dconfig%2Dlabel%7B%0Awidth%3A120px%3B%0Aheight%3A25px%3B%0Aline%2Dheight%3A%2025px%3B%0A%7D%0Adiv%2Evis%2Dconfiguration%2Evis%2Dconfig%2Dlabel%2Evis%2Dconfig%2Ds3%7B%0Awidth%3A110px%3B%0A%7D%0Adiv%2Evis%2Dconfiguration%2Evis%2Dconfig%2Dlabel%2Evis%2Dconfig%2Ds4%7B%0Awidth%3A100px%3B%0A%7D%0Adiv%2Evis%2Dconfiguration%2Evis%2Dconfig%2DcolorBlock%7B%0Atop%3A1px%3B%0Awidth%3A30px%3B%0Aheight%3A19px%3B%0Aborder%3A1px%20solid%20%23444444%3B%0Aborder%2Dradius%3A2px%3B%0Apadding%3A0px%3B%0Amargin%3A0px%3B%0Acursor%3Apointer%3B%0A%7D%0Ainput%2Evis%2Dconfiguration%2Evis%2Dconfig%2Dcheckbox%20%7B%0Aleft%3A%2D5px%3B%0A%7D%0Ainput%2Evis%2Dconfiguration%2Evis%2Dconfig%2Drangeinput%7B%0Aposition%3Arelative%3B%0Atop%3A%2D5px%3B%0Awidth%3A60px%3B%0A%0Apadding%3A1px%3B%0Amargin%3A0%3B%0Apointer%2Devents%3Anone%3B%0A%7D%0Ainput%2Evis%2Dconfiguration%2Evis%2Dconfig%2Drange%7B%0A%0A%2Dwebkit%2Dappearance%3A%20none%3B%0A%0Aborder%3A%200px%20solid%20white%3B%0Abackground%2Dcolor%3Argba%280%2C0%2C0%2C0%29%3B%0A%0Awidth%3A%20300px%3B%0Aheight%3A20px%3B%0A%7D%0Ainput%2Evis%2Dconfiguration%2Evis%2Dconfig%2Drange%3A%3A%2Dwebkit%2Dslider%2Drunnable%2Dtrack%20%7B%0Awidth%3A%20300px%3B%0Aheight%3A%205px%3B%0Abackground%3A%20%23dedede%3B%20%0Abackground%3A%20%2Dmoz%2Dlinear%2Dgradient%28top%2C%20%23dedede%200%25%2C%20%23c8c8c8%2099%25%29%3B%20%0Abackground%3A%20%2Dwebkit%2Dgradient%28linear%2C%20left%20top%2C%20left%20bottom%2C%20color%2Dstop%280%25%2C%23dedede%29%2C%20color%2Dstop%2899%25%2C%23c8c8c8%29%29%3B%20%0Abackground%3A%20%2Dwebkit%2Dlinear%2Dgradient%28top%2C%20%23dedede%200%25%2C%23c8c8c8%2099%25%29%3B%20%0Abackground%3A%20%2Do%2Dlinear%2Dgradient%28top%2C%20%23dedede%200%25%2C%20%23c8c8c8%2099%25%29%3B%20%0Abackground%3A%20%2Dms%2Dlinear%2Dgradient%28top%2C%20%23dedede%200%25%2C%23c8c8c8%2099%25%29%3B%20%0Abackground%3A%20linear%2Dgradient%28to%20bottom%2C%20%23dedede%200%25%2C%23c8c8c8%2099%25%29%3B%20%0Afilter%3A%20progid%3ADXImageTransform%2EMicrosoft%2Egradient%28%20startColorstr%3D%27%23dedede%27%2C%20endColorstr%3D%27%23c8c8c8%27%2CGradientType%3D0%20%29%3B%20%0Aborder%3A%201px%20solid%20%23999999%3B%0Abox%2Dshadow%3A%20%23aaaaaa%200px%200px%203px%200px%3B%0Aborder%2Dradius%3A%203px%3B%0A%7D%0Ainput%2Evis%2Dconfiguration%2Evis%2Dconfig%2Drange%3A%3A%2Dwebkit%2Dslider%2Dthumb%20%7B%0A%2Dwebkit%2Dappearance%3A%20none%3B%0Aborder%3A%201px%20solid%20%2314334b%3B%0Aheight%3A%2017px%3B%0Awidth%3A%2017px%3B%0Aborder%2Dradius%3A%2050%25%3B%0Abackground%3A%20%233876c2%3B%20%0Abackground%3A%20%2Dmoz%2Dlinear%2Dgradient%28top%2C%20%233876c2%200%25%2C%20%23385380%20100%25%29%3B%20%0Abackground%3A%20%2Dwebkit%2Dgradient%28linear%2C%20left%20top%2C%20left%20bottom%2C%20color%2Dstop%280%25%2C%233876c2%29%2C%20color%2Dstop%28100%25%2C%23385380%29%29%3B%20%0Abackground%3A%20%2Dwebkit%2Dlinear%2Dgradient%28top%2C%20%233876c2%200%25%2C%23385380%20100%25%29%3B%20%0Abackground%3A%20%2Do%2Dlinear%2Dgradient%28top%2C%20%233876c2%200%25%2C%23385380%20100%25%29%3B%20%0Abackground%3A%20%2Dms%2Dlinear%2Dgradient%28top%2C%20%233876c2%200%25%2C%23385380%20100%25%29%3B%20%0Abackground%3A%20linear%2Dgradient%28to%20bottom%2C%20%233876c2%200%25%2C%23385380%20100%25%29%3B%20%0Afilter%3A%20progid%3ADXImageTransform%2EMicrosoft%2Egradient%28%20startColorstr%3D%27%233876c2%27%2C%20endColorstr%3D%27%23385380%27%2CGradientType%3D0%20%29%3B%20%0Abox%2Dshadow%3A%20%23111927%200px%200px%201px%200px%3B%0Amargin%2Dtop%3A%20%2D7px%3B%0A%7D%0Ainput%2Evis%2Dconfiguration%2Evis%2Dconfig%2Drange%3Afocus%20%7B%0Aoutline%3A%20none%3B%0A%7D%0Ainput%2Evis%2Dconfiguration%2Evis%2Dconfig%2Drange%3Afocus%3A%3A%2Dwebkit%2Dslider%2Drunnable%2Dtrack%20%7B%0Abackground%3A%20%239d9d9d%3B%20%0Abackground%3A%20%2Dmoz%2Dlinear%2Dgradient%28top%2C%20%239d9d9d%200%25%2C%20%23c8c8c8%2099%25%29%3B%20%0Abackground%3A%20%2Dwebkit%2Dgradient%28linear%2C%20left%20top%2C%20left%20bottom%2C%20color%2Dstop%280%25%2C%239d9d9d%29%2C%20color%2Dstop%2899%25%2C%23c8c8c8%29%29%3B%20%0Abackground%3A%20%2Dwebkit%2Dlinear%2Dgradient%28top%2C%20%239d9d9d%200%25%2C%23c8c8c8%2099%25%29%3B%20%0Abackground%3A%20%2Do%2Dlinear%2Dgradient%28top%2C%20%239d9d9d%200%25%2C%23c8c8c8%2099%25%29%3B%20%0Abackground%3A%20%2Dms%2Dlinear%2Dgradient%28top%2C%20%239d9d9d%200%25%2C%23c8c8c8%2099%25%29%3B%20%0Abackground%3A%20linear%2Dgradient%28to%20bottom%2C%20%239d9d9d%200%25%2C%23c8c8c8%2099%25%29%3B%20%0Afilter%3A%20progid%3ADXImageTransform%2EMicrosoft%2Egradient%28%20startColorstr%3D%27%239d9d9d%27%2C%20endColorstr%3D%27%23c8c8c8%27%2CGradientType%3D0%20%29%3B%20%0A%7D%0Ainput%2Evis%2Dconfiguration%2Evis%2Dconfig%2Drange%3A%3A%2Dmoz%2Drange%2Dtrack%20%7B%0Awidth%3A%20300px%3B%0Aheight%3A%2010px%3B%0Abackground%3A%20%23dedede%3B%20%0Abackground%3A%20%2Dmoz%2Dlinear%2Dgradient%28top%2C%20%23dedede%200%25%2C%20%23c8c8c8%2099%25%29%3B%20%0Abackground%3A%20%2Dwebkit%2Dgradient%28linear%2C%20left%20top%2C%20left%20bottom%2C%20color%2Dstop%280%25%2C%23dedede%29%2C%20color%2Dstop%2899%25%2C%23c8c8c8%29%29%3B%20%0Abackground%3A%20%2Dwebkit%2Dlinear%2Dgradient%28top%2C%20%23dedede%200%25%2C%23c8c8c8%2099%25%29%3B%20%0Abackground%3A%20%2Do%2Dlinear%2Dgradient%28top%2C%20%23dedede%200%25%2C%20%23c8c8c8%2099%25%29%3B%20%0Abackground%3A%20%2Dms%2Dlinear%2Dgradient%28top%2C%20%23dedede%200%25%2C%23c8c8c8%2099%25%29%3B%20%0Abackground%3A%20linear%2Dgradient%28to%20bottom%2C%20%23dedede%200%25%2C%23c8c8c8%2099%25%29%3B%20%0Afilter%3A%20progid%3ADXImageTransform%2EMicrosoft%2Egradient%28%20startColorstr%3D%27%23dedede%27%2C%20endColorstr%3D%27%23c8c8c8%27%2CGradientType%3D0%20%29%3B%20%0Aborder%3A%201px%20solid%20%23999999%3B%0Abox%2Dshadow%3A%20%23aaaaaa%200px%200px%203px%200px%3B%0Aborder%2Dradius%3A%203px%3B%0A%7D%0Ainput%2Evis%2Dconfiguration%2Evis%2Dconfig%2Drange%3A%3A%2Dmoz%2Drange%2Dthumb%20%7B%0Aborder%3A%20none%3B%0Aheight%3A%2016px%3B%0Awidth%3A%2016px%3B%0Aborder%2Dradius%3A%2050%25%3B%0Abackground%3A%20%23385380%3B%0A%7D%0A%0Ainput%2Evis%2Dconfiguration%2Evis%2Dconfig%2Drange%3A%2Dmoz%2Dfocusring%7B%0Aoutline%3A%201px%20solid%20white%3B%0Aoutline%2Doffset%3A%20%2D1px%3B%0A%7D%0Ainput%2Evis%2Dconfiguration%2Evis%2Dconfig%2Drange%3A%3A%2Dms%2Dtrack%20%7B%0Awidth%3A%20300px%3B%0Aheight%3A%205px%3B%0A%0Abackground%3A%20transparent%3B%0A%0Aborder%2Dcolor%3A%20transparent%3B%0Aborder%2Dwidth%3A%206px%200%3B%0A%0Acolor%3A%20transparent%3B%0A%7D%0Ainput%2Evis%2Dconfiguration%2Evis%2Dconfig%2Drange%3A%3A%2Dms%2Dfill%2Dlower%20%7B%0Abackground%3A%20%23777%3B%0Aborder%2Dradius%3A%2010px%3B%0A%7D%0Ainput%2Evis%2Dconfiguration%2Evis%2Dconfig%2Drange%3A%3A%2Dms%2Dfill%2Dupper%20%7B%0Abackground%3A%20%23ddd%3B%0Aborder%2Dradius%3A%2010px%3B%0A%7D%0Ainput%2Evis%2Dconfiguration%2Evis%2Dconfig%2Drange%3A%3A%2Dms%2Dthumb%20%7B%0Aborder%3A%20none%3B%0Aheight%3A%2016px%3B%0Awidth%3A%2016px%3B%0Aborder%2Dradius%3A%2050%25%3B%0Abackground%3A%20%23385380%3B%0A%7D%0Ainput%2Evis%2Dconfiguration%2Evis%2Dconfig%2Drange%3Afocus%3A%3A%2Dms%2Dfill%2Dlower%20%7B%0Abackground%3A%20%23888%3B%0A%7D%0Ainput%2Evis%2Dconfiguration%2Evis%2Dconfig%2Drange%3Afocus%3A%3A%2Dms%2Dfill%2Dupper%20%7B%0Abackground%3A%20%23ccc%3B%0A%7D%0A%2Evis%2Dconfiguration%2Dpopup%20%7B%0Aposition%3A%20absolute%3B%0Abackground%3A%20rgba%2857%2C%2076%2C%2089%2C%200%2E85%29%3B%0Aborder%3A%202px%20solid%20%23f2faff%3B%0Aline%2Dheight%3A30px%3B%0Aheight%3A30px%3B%0Awidth%3A150px%3B%0Atext%2Dalign%3Acenter%3B%0Acolor%3A%20%23ffffff%3B%0Afont%2Dsize%3A14px%3B%0Aborder%2Dradius%3A4px%3B%0A%2Dwebkit%2Dtransition%3A%20opacity%200%2E3s%20ease%2Din%2Dout%3B%0A%2Dmoz%2Dtransition%3A%20opacity%200%2E3s%20ease%2Din%2Dout%3B%0Atransition%3A%20opacity%200%2E3s%20ease%2Din%2Dout%3B%0A%7D%0A%2Evis%2Dconfiguration%2Dpopup%3Aafter%2C%20%2Evis%2Dconfiguration%2Dpopup%3Abefore%20%7B%0Aleft%3A%20100%25%3B%0Atop%3A%2050%25%3B%0Aborder%3A%20solid%20transparent%3B%0Acontent%3A%20%22%20%22%3B%0Aheight%3A%200%3B%0Awidth%3A%200%3B%0Aposition%3A%20absolute%3B%0Apointer%2Devents%3A%20none%3B%0A%7D%0A%2Evis%2Dconfiguration%2Dpopup%3Aafter%20%7B%0Aborder%2Dcolor%3A%20rgba%28136%2C%20183%2C%20213%2C%200%29%3B%0Aborder%2Dleft%2Dcolor%3A%20rgba%2857%2C%2076%2C%2089%2C%200%2E85%29%3B%0Aborder%2Dwidth%3A%208px%3B%0Amargin%2Dtop%3A%20%2D8px%3B%0A%7D%0A%2Evis%2Dconfiguration%2Dpopup%3Abefore%20%7B%0Aborder%2Dcolor%3A%20rgba%28194%2C%20225%2C%20245%2C%200%29%3B%0Aborder%2Dleft%2Dcolor%3A%20%23f2faff%3B%0Aborder%2Dwidth%3A%2012px%3B%0Amargin%2Dtop%3A%20%2D12px%3B%0A%7D%0Adiv%2Evis%2Dtooltip%20%7B%0Aposition%3A%20absolute%3B%0Avisibility%3A%20hidden%3B%0Apadding%3A%205px%3B%0Awhite%2Dspace%3A%20nowrap%3B%0Afont%2Dfamily%3A%20verdana%3B%0Afont%2Dsize%3A14px%3B%0Acolor%3A%23000000%3B%0Abackground%2Dcolor%3A%20%23f5f4ed%3B%0A%2Dmoz%2Dborder%2Dradius%3A%203px%3B%0A%2Dwebkit%2Dborder%2Dradius%3A%203px%3B%0Aborder%2Dradius%3A%203px%3B%0Aborder%3A%201px%20solid%20%23808074%3B%0Abox%2Dshadow%3A%203px%203px%2010px%20rgba%280%2C%200%2C%200%2C%200%2E2%29%3B%0Apointer%2Devents%3A%20none%3B%0Az%2Dindex%3A%205%3B%0A%7D%0Adiv%2Evis%2Dcolor%2Dpicker%20%7B%0Aposition%3Aabsolute%3B%0Atop%3A%200px%3B%0Aleft%3A%2030px%3B%0Amargin%2Dtop%3A%2D140px%3B%0Amargin%2Dleft%3A30px%3B%0Awidth%3A310px%3B%0Aheight%3A444px%3B%0Az%2Dindex%3A%201%3B%0Apadding%3A%2010px%3B%0Aborder%2Dradius%3A15px%3B%0Abackground%2Dcolor%3A%23ffffff%3B%0Adisplay%3A%20none%3B%0Abox%2Dshadow%3A%20rgba%280%2C0%2C0%2C0%2E5%29%200px%200px%2010px%200px%3B%0A%7D%0Adiv%2Evis%2Dcolor%2Dpicker%20div%2Evis%2Darrow%20%7B%0Aposition%3A%20absolute%3B%0Atop%3A147px%3B%0Aleft%3A5px%3B%0A%7D%0Adiv%2Evis%2Dcolor%2Dpicker%20div%2Evis%2Darrow%3A%3Aafter%2C%0Adiv%2Evis%2Dcolor%2Dpicker%20div%2Evis%2Darrow%3A%3Abefore%20%7B%0Aright%3A%20100%25%3B%0Atop%3A%2050%25%3B%0Aborder%3A%20solid%20transparent%3B%0Acontent%3A%20%22%20%22%3B%0Aheight%3A%200%3B%0Awidth%3A%200%3B%0Aposition%3A%20absolute%3B%0Apointer%2Devents%3A%20none%3B%0A%7D%0Adiv%2Evis%2Dcolor%2Dpicker%20div%2Evis%2Darrow%3Aafter%20%7B%0Aborder%2Dcolor%3A%20rgba%28255%2C%20255%2C%20255%2C%200%29%3B%0Aborder%2Dright%2Dcolor%3A%20%23ffffff%3B%0Aborder%2Dwidth%3A%2030px%3B%0Amargin%2Dtop%3A%20%2D30px%3B%0A%7D%0Adiv%2Evis%2Dcolor%2Dpicker%20div%2Evis%2Dcolor%20%7B%0Aposition%3Aabsolute%3B%0Awidth%3A%20289px%3B%0Aheight%3A%20289px%3B%0Acursor%3A%20pointer%3B%0A%7D%0Adiv%2Evis%2Dcolor%2Dpicker%20div%2Evis%2Dbrightness%20%7B%0Aposition%3A%20absolute%3B%0Atop%3A313px%3B%0A%7D%0Adiv%2Evis%2Dcolor%2Dpicker%20div%2Evis%2Dopacity%20%7B%0Aposition%3Aabsolute%3B%0Atop%3A350px%3B%0A%7D%0Adiv%2Evis%2Dcolor%2Dpicker%20div%2Evis%2Dselector%20%7B%0Aposition%3Aabsolute%3B%0Atop%3A137px%3B%0Aleft%3A137px%3B%0Awidth%3A15px%3B%0Aheight%3A15px%3B%0Aborder%2Dradius%3A15px%3B%0Aborder%3A1px%20solid%20%23ffffff%3B%0Abackground%3A%20%234c4c4c%3B%20%0Abackground%3A%20%2Dmoz%2Dlinear%2Dgradient%28top%2C%20%234c4c4c%200%25%2C%20%23595959%2012%25%2C%20%23666666%2025%25%2C%20%23474747%2039%25%2C%20%232c2c2c%2050%25%2C%20%23000000%2051%25%2C%20%23111111%2060%25%2C%20%232b2b2b%2076%25%2C%20%231c1c1c%2091%25%2C%20%23131313%20100%25%29%3B%20%0Abackground%3A%20%2Dwebkit%2Dgradient%28linear%2C%20left%20top%2C%20left%20bottom%2C%20color%2Dstop%280%25%2C%234c4c4c%29%2C%20color%2Dstop%2812%25%2C%23595959%29%2C%20color%2Dstop%2825%25%2C%23666666%29%2C%20color%2Dstop%2839%25%2C%23474747%29%2C%20color%2Dstop%2850%25%2C%232c2c2c%29%2C%20color%2Dstop%2851%25%2C%23000000%29%2C%20color%2Dstop%2860%25%2C%23111111%29%2C%20color%2Dstop%2876%25%2C%232b2b2b%29%2C%20color%2Dstop%2891%25%2C%231c1c1c%29%2C%20color%2Dstop%28100%25%2C%23131313%29%29%3B%20%0Abackground%3A%20%2Dwebkit%2Dlinear%2Dgradient%28top%2C%20%234c4c4c%200%25%2C%23595959%2012%25%2C%23666666%2025%25%2C%23474747%2039%25%2C%232c2c2c%2050%25%2C%23000000%2051%25%2C%23111111%2060%25%2C%232b2b2b%2076%25%2C%231c1c1c%2091%25%2C%23131313%20100%25%29%3B%20%0Abackground%3A%20%2Do%2Dlinear%2Dgradient%28top%2C%20%234c4c4c%200%25%2C%23595959%2012%25%2C%23666666%2025%25%2C%23474747%2039%25%2C%232c2c2c%2050%25%2C%23000000%2051%25%2C%23111111%2060%25%2C%232b2b2b%2076%25%2C%231c1c1c%2091%25%2C%23131313%20100%25%29%3B%20%0Abackground%3A%20%2Dms%2Dlinear%2Dgradient%28top%2C%20%234c4c4c%200%25%2C%23595959%2012%25%2C%23666666%2025%25%2C%23474747%2039%25%2C%232c2c2c%2050%25%2C%23000000%2051%25%2C%23111111%2060%25%2C%232b2b2b%2076%25%2C%231c1c1c%2091%25%2C%23131313%20100%25%29%3B%20%0Abackground%3A%20linear%2Dgradient%28to%20bottom%2C%20%234c4c4c%200%25%2C%23595959%2012%25%2C%23666666%2025%25%2C%23474747%2039%25%2C%232c2c2c%2050%25%2C%23000000%2051%25%2C%23111111%2060%25%2C%232b2b2b%2076%25%2C%231c1c1c%2091%25%2C%23131313%20100%25%29%3B%20%0Afilter%3A%20progid%3ADXImageTransform%2EMicrosoft%2Egradient%28%20startColorstr%3D%27%234c4c4c%27%2C%20endColorstr%3D%27%23131313%27%2CGradientType%3D0%20%29%3B%20%0A%7D%0Adiv%2Evis%2Dcolor%2Dpicker%20div%2Evis%2Dnew%2Dcolor%20%7B%0Aposition%3Aabsolute%3B%0Awidth%3A140px%3B%0Aheight%3A20px%3B%0Aborder%3A1px%20solid%20rgba%280%2C0%2C0%2C0%2E1%29%3B%0Aborder%2Dradius%3A5px%3B%0Atop%3A380px%3B%0Aleft%3A159px%3B%0Atext%2Dalign%3Aright%3B%0Apadding%2Dright%3A2px%3B%0Afont%2Dsize%3A10px%3B%0Acolor%3Argba%280%2C0%2C0%2C0%2E4%29%3B%0Avertical%2Dalign%3Amiddle%3B%0Aline%2Dheight%3A20px%3B%0A%7D%0Adiv%2Evis%2Dcolor%2Dpicker%20div%2Evis%2Dinitial%2Dcolor%20%7B%0Aposition%3Aabsolute%3B%0Awidth%3A140px%3B%0Aheight%3A20px%3B%0Aborder%3A1px%20solid%20rgba%280%2C0%2C0%2C0%2E1%29%3B%0Aborder%2Dradius%3A5px%3B%0Atop%3A380px%3B%0Aleft%3A10px%3B%0Atext%2Dalign%3Aleft%3B%0Apadding%2Dleft%3A2px%3B%0Afont%2Dsize%3A10px%3B%0Acolor%3Argba%280%2C0%2C0%2C0%2E4%29%3B%0Avertical%2Dalign%3Amiddle%3B%0Aline%2Dheight%3A20px%3B%0A%7D%0Adiv%2Evis%2Dcolor%2Dpicker%20div%2Evis%2Dlabel%20%7B%0Aposition%3Aabsolute%3B%0Awidth%3A300px%3B%0Aleft%3A10px%3B%0A%7D%0Adiv%2Evis%2Dcolor%2Dpicker%20div%2Evis%2Dlabel%2Evis%2Dbrightness%20%7B%0Atop%3A300px%3B%0A%7D%0Adiv%2Evis%2Dcolor%2Dpicker%20div%2Evis%2Dlabel%2Evis%2Dopacity%20%7B%0Atop%3A338px%3B%0A%7D%0Adiv%2Evis%2Dcolor%2Dpicker%20div%2Evis%2Dbutton%20%7B%0Aposition%3Aabsolute%3B%0Awidth%3A68px%3B%0Aheight%3A25px%3B%0Aborder%2Dradius%3A10px%3B%0Avertical%2Dalign%3A%20middle%3B%0Atext%2Dalign%3Acenter%3B%0Aline%2Dheight%3A%2025px%3B%0Atop%3A410px%3B%0Aborder%3A2px%20solid%20%23d9d9d9%3B%0Abackground%2Dcolor%3A%20%23f7f7f7%3B%0Acursor%3Apointer%3B%0A%7D%0Adiv%2Evis%2Dcolor%2Dpicker%20div%2Evis%2Dbutton%2Evis%2Dcancel%20%7B%0A%0A%0Aleft%3A5px%3B%0A%7D%0Adiv%2Evis%2Dcolor%2Dpicker%20div%2Evis%2Dbutton%2Evis%2Dload%20%7B%0A%0A%0Aleft%3A82px%3B%0A%7D%0Adiv%2Evis%2Dcolor%2Dpicker%20div%2Evis%2Dbutton%2Evis%2Dapply%20%7B%0A%0A%0Aleft%3A159px%3B%0A%7D%0Adiv%2Evis%2Dcolor%2Dpicker%20div%2Evis%2Dbutton%2Evis%2Dsave%20%7B%0A%0A%0Aleft%3A236px%3B%0A%7D%0Adiv%2Evis%2Dcolor%2Dpicker%20input%2Evis%2Drange%20%7B%0Awidth%3A%20290px%3B%0Aheight%3A20px%3B%0A%7D%0A%0Adiv%2Evis%2Dnetwork%20div%2Evis%2Dmanipulation%20%7B%0Abox%2Dsizing%3A%20content%2Dbox%3B%0Aborder%2Dwidth%3A%200%3B%0Aborder%2Dbottom%3A%201px%3B%0Aborder%2Dstyle%3Asolid%3B%0Aborder%2Dcolor%3A%20%23d6d9d8%3B%0Abackground%3A%20%23ffffff%3B%20%0Abackground%3A%20%2Dmoz%2Dlinear%2Dgradient%28top%2C%20%23ffffff%200%25%2C%20%23fcfcfc%2048%25%2C%20%23fafafa%2050%25%2C%20%23fcfcfc%20100%25%29%3B%20%0Abackground%3A%20%2Dwebkit%2Dgradient%28linear%2C%20left%20top%2C%20left%20bottom%2C%20color%2Dstop%280%25%2C%23ffffff%29%2C%20color%2Dstop%2848%25%2C%23fcfcfc%29%2C%20color%2Dstop%2850%25%2C%23fafafa%29%2C%20color%2Dstop%28100%25%2C%23fcfcfc%29%29%3B%20%0Abackground%3A%20%2Dwebkit%2Dlinear%2Dgradient%28top%2C%20%23ffffff%200%25%2C%23fcfcfc%2048%25%2C%23fafafa%2050%25%2C%23fcfcfc%20100%25%29%3B%20%0Abackground%3A%20%2Do%2Dlinear%2Dgradient%28top%2C%20%23ffffff%200%25%2C%23fcfcfc%2048%25%2C%23fafafa%2050%25%2C%23fcfcfc%20100%25%29%3B%20%0Abackground%3A%20%2Dms%2Dlinear%2Dgradient%28top%2C%20%23ffffff%200%25%2C%23fcfcfc%2048%25%2C%23fafafa%2050%25%2C%23fcfcfc%20100%25%29%3B%20%0Abackground%3A%20linear%2Dgradient%28to%20bottom%2C%20%23ffffff%200%25%2C%23fcfcfc%2048%25%2C%23fafafa%2050%25%2C%23fcfcfc%20100%25%29%3B%20%0Afilter%3A%20progid%3ADXImageTransform%2EMicrosoft%2Egradient%28%20startColorstr%3D%27%23ffffff%27%2C%20endColorstr%3D%27%23fcfcfc%27%2CGradientType%3D0%20%29%3B%20%0Apadding%2Dtop%3A4px%3B%0Aposition%3A%20absolute%3B%0Aleft%3A%200%3B%0Atop%3A%200%3B%0Awidth%3A%20100%25%3B%0Aheight%3A%2028px%3B%0A%7D%0Adiv%2Evis%2Dnetwork%20div%2Evis%2Dedit%2Dmode%20%7B%0Aposition%3Aabsolute%3B%0Aleft%3A%200%3B%0Atop%3A%205px%3B%0Aheight%3A%2030px%3B%0A%7D%0A%0Adiv%2Evis%2Dnetwork%20div%2Evis%2Dclose%20%7B%0Aposition%3Aabsolute%3B%0Aright%3A%200%3B%0Atop%3A%200%3B%0Awidth%3A%2030px%3B%0Aheight%3A%2030px%3B%0Abackground%2Dposition%3A%2020px%203px%3B%0Abackground%2Drepeat%3A%20no%2Drepeat%3B%0Abackground%2Dimage%3A%20url%28data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89%2BbN%2FrXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz%2FSMBAPh%2BPDwrIsAHvgABeNMLCADATZvAMByH%2Fw%2FqQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf%2BbTAICd%2BJl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA%2Fg88wAAKCRFRHgg%2FP9eM4Ors7ONo62Dl8t6r8G%2FyJiYuP%2B5c%2BrcEAAAOF0ftH%2BLC%2BzGoA7BoBt%2FqIl7gRoXgugdfeLZrIPQLUAoOnaV%2FNw%2BH48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl%2FAV%2F1s%2BX48%2FPf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H%2FLcL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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIAo8P3hwYWNrZXQgZW5kPSJ3Ij8%2BcZUZMwAAACBjSFJNAAB6JQAAgIMAAPn%2FAACA6QAAdTAAAOpgAAA6mAAAF2%2BSX8VGAAAA2ElEQVR42gDLADT%2FAS0tLUQFBQUVFxcXtPHx8fPl5eUNCAgITCkpKesEHx8fGgYGBjH%2B%2Fv4a%2BPj4qgQEBFU6OjodMTExzwQUFBSvEBAQEfX19SD19fVqNDQ0CElJSd%2F9%2Ff2vAwEBAfrn5%2BfkBwcHLRYWFgsXFxfz29vbo9LS0uwDDQ0NDfPz81orKysXIyMj%2BODg4Avh4eEa%2Ff391gMkJCRYPz8%2FKUhISOMCAgKh8fHxHRsbGx4UFBQQBDk5OeY7Ozv7CAgItPb29vMEBASaJSUlTQ0NDesDAEwpT0Ko8Ri2AAAAAElFTkSuQmCC%29%3B%0Acursor%3A%20pointer%3B%0A%2Dwebkit%2Dtouch%2Dcallout%3A%20none%3B%0A%2Dwebkit%2Duser%2Dselect%3A%20none%3B%0A%2Dkhtml%2Duser%2Dselect%3A%20none%3B%0A%2Dmoz%2Duser%2Dselect%3A%20none%3B%0A%2Dms%2Duser%2Dselect%3A%20none%3B%0Auser%2Dselect%3A%20none%3B%0A%7D%0Adiv%2Evis%2Dnetwork%20div%2Evis%2Dclose%3Ahover%20%7B%0Aopacity%3A%200%2E6%3B%0A%7D%0Adiv%2Evis%2Dnetwork%20div%2Evis%2Dmanipulation%20div%2Evis%2Dbutton%2C%0Adiv%2Evis%2Dnetwork%20div%2Evis%2Dedit%2Dmode%20div%2Evis%2Dbutton%20%7B%0Afloat%3Aleft%3B%0Afont%2Dfamily%3A%20verdana%3B%0Afont%2Dsize%3A%2012px%3B%0A%2Dmoz%2Dborder%2Dradius%3A%2015px%3B%0Aborder%2Dradius%3A%2015px%3B%0Adisplay%3Ainline%2Dblock%3B%0Abackground%2Dposition%3A%200px%200px%3B%0Abackground%2Drepeat%3Ano%2Drepeat%3B%0Aheight%3A24px%3B%0Amargin%2Dleft%3A%2010px%3B%0A%0Acursor%3A%20pointer%3B%0Apadding%3A%200px%208px%200px%208px%3B%0A%2Dwebkit%2Dtouch%2Dcallout%3A%20none%3B%0A%2Dwebkit%2Duser%2Dselect%3A%20none%3B%0A%2Dkhtml%2Duser%2Dselect%3A%20none%3B%0A%2Dmoz%2Duser%2Dselect%3A%20none%3B%0A%2Dms%2Duser%2Dselect%3A%20none%3B%0Auser%2Dselect%3A%20none%3B%0A%7D%0Adiv%2Evis%2Dnetwork%20div%2Evis%2Dmanipulation%20div%2Evis%2Dbutton%3Ahover%20%7B%0Abox%2Dshadow%3A%201px%201px%208px%20rgba%280%2C%200%2C%200%2C%200%2E20%29%3B%0A%7D%0Adiv%2Evis%2Dnetwork%20div%2Evis%2Dmanipulation%20div%2Evis%2Dbutton%3Aactive%20%7B%0Abox%2Dshadow%3A%201px%201px%208px%20rgba%280%2C%200%2C%200%2C%200%2E50%29%3B%0A%7D%0Adiv%2Evis%2Dnetwork%20div%2Evis%2Dmanipulation%20div%2Evis%2Dbutton%2Evis%2Dback%20%7B%0Abackground%2Dimage%3A%20url%28data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89%2BbN%2FrXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz%2FSMBAPh%2BPDwrIsAHvgABeNMLCADATZvAMByH%2Fw%2FqQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf%2BbTAICd%2BJl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA%2Fg88wAAKCRFRHgg%2FP9eM4Ors7ONo62Dl8t6r8G%2FyJiYuP%2B5c%2BrcEAAAOF0ftH%2BLC%2BzGoA7BoBt%2FqIl7gRoXgugdfeLZrIPQLUAoOnaV%2FNw%2BH48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl%2FAV%2F1s%2BX48%2FPf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H%2FLcL%2F%2Fwd0y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klDQ1Byb2ZpbGU%2BCiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24%2BCiAgICAgICAgIDx0aWZmOlhSZXNvbHV0aW9uPjcyMDA5MC8xMDAwMDwvdGlmZjpYUmVzb2x1dGlvbj4KICAgICAgICAgPHRpZmY6WVJlc29sdXRpb24%2BNzIwMDkwLzEwMDAwPC90aWZmOllSZXNvbHV0aW9uPgogICAgICAgICA8dGlmZjpSZXNvbHV0aW9uVW5pdD4yPC90aWZmOlJlc29sdXRpb25Vbml0PgogICAgICAgICA8ZXhpZjpDb2xvclNwYWNlPjE8L2V4aWY6Q29sb3JTcGFjZT4KICAgICAgICAgPGV4aWY6UGl4ZWxYRGltZW5zaW9uPjI0PC9leGlmOlBpeGVsWERpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6UGl4ZWxZRGltZW5zaW9uPjI0PC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24%2BCiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE%2BCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw%2FeHBhY2tldCBlbmQ9InciPz4jq1U%2FAAAAIGNIUk0AAHolAACAgwAA%2Bf8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAVTSURBVHjanFVfTFNnFP%2Bd77ve8qeVFbBrpcVgRrCRFikFByLxwSAaE32oRCHD6JMxxhhn8G2RxxH3MsOTbyYsmCAxPMmMMYtkIUYmK60OO0qAK23BFlNob0uh3x7WS5jLZPpLbm6%2Bk%2FP9zrm5v9855PF4UFhYCABgjIExBgAgIqRSqRIi6gDQRkQ1RGTB3wgR0e8AHgH4Sa%2FXR%2FEBiAiJRAJ04cIF5Ofng4g2n0gkUkxENwF0c843LzHGQEQQQkCLExEA9ALotVgsUQAQQmgNQhJCbF5kjCEUCl0moj4t5na7fTU1NUpVVVXUYrEkASAcDhe8efOmxOfzWScmJqoBdBNR99LS0hWz2dynNSSEAF28eBGFhYVgjCEcDn9HRD1EhIMHD3o9Hs9kWVlZAh9BKBQqGB4edr58%2BdKZ%2B6JbJpOpBwBWV1fB6%2BrqIMsyIpHIFcZYL2MMra2tY5cuXRrfuXNnBtvAYDBk3G63oqpqZm5uzgrgSDKZjBoMhueZTAbc5XIhFouVEtFTxhiOHTs2dv78eS8%2BEfv374%2BoqpqZnZ21cs5PJJPJPlmWkyynnB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%2B%2Btynd8yGo29RIR0Og26fv06ioqKwBgD5xzv3r27zBjrIyJIkgSHwzFZWVmp7NmzJ1ZaWpoAgGg0WqgoSvHMzIw1GAw6tvjhitFo7NPW5fv370Hd3d0oKCgA53zTQMvLy%2BVCiKuSJH0rSdLmztZytIWv5RPRD0T0Y3Fx8dzWfby6ugopHo%2F%2Fw4mcc8iyPMc5v5FOp7%2FPZrOdQohWInIC2C2EgBBigYi8Qoifs9lsv06nWyIiaFxagXg8jr8GAGxuIe7LBeWhAAAAAElFTkSuQmCC%29%3B%0A%7D%0Adiv%2Evis%2Dnetwork%20div%2Evis%2Dmanipulation%20div%2Evis%2Dbutton%2Evis%2Dnone%3Ahover%20%7B%0Abox%2Dshadow%3A%201px%201px%208px%20rgba%280%2C%200%2C%200%2C%200%2E0%29%3B%0Acursor%3A%20default%3B%0A%7D%0Adiv%2Evis%2Dnetwork%20div%2Evis%2Dmanipulation%20div%2Evis%2Dbutton%2Evis%2Dnone%3Aactive%20%7B%0Abox%2Dshadow%3A%201px%201px%208px%20rgba%280%2C%200%2C%200%2C%200%2E0%29%3B%0A%7D%0Adiv%2Evis%2Dnetwork%20div%2Evis%2Dmanipulation%20div%2Evis%2Dbutton%2Evis%2Dnone%20%7B%0Apadding%3A%200%3B%0A%7D%0Adiv%2Evis%2Dnetwork%20div%2Evis%2Dmanipulation%20div%2Enotification%20%7B%0Amargin%3A%202px%3B%0Afont%2Dweight%3A%20bold%3B%0A%7D%0Adiv%2Evis%2Dnetwork%20div%2Evis%2Dmanipulation%20div%2Evis%2Dbutton%2Evis%2Dadd%20%7B%0Abackground%2Dimage%3A%20url%28data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUU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bWVuc2lvbj4KICAgICAgICAgPGV4aWY6UGl4ZWxZRGltZW5zaW9uPjI0PC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24%2BCiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE%2BCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw%2FeHBhY2tldCBlbmQ9InciPz5WKqp9AAAAIGNIUk0AAHolAACA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q6uDpmkQkcStorX4XRcM1FjZ%2BkvFFjCJKU1WpkNJJUqIMtX1RyLeX3JtQ0JRhmGYZ%2FL27duRnJycuFGISOJ9pqh5lrB6iYgqGOxRrOaa54DcZmKvkJxk8JHC9rKh%2BKVhOsD4%2BDj%2BMwADIf8n5m4xGwAAAABJRU5ErkJggg%3D%3D%29%3B%0A%7D%0Adiv%2Evis%2Dnetwork%20div%2Evis%2Dmanipulation%20div%2Evis%2Dbutton%2Evis%2Dedit%2C%0Adiv%2Evis%2Dnetwork%20div%2Evis%2Dedit%2Dmode%20div%2Evis%2Dbutton%2Evis%2Dedit%20%7B%0Abackground%2Dimage%3A%20url%28data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89%2BbN%2FrXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz%2FSMBAPh%2BPDwrIsAHvgABeNMLCADATZvAMByH%2Fw%2FqQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf%2BbTAICd%2BJl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA%2Fg88wAAKCRFRHgg%2FP9eM4Ors7ONo62Dl8t6r8G%2FyJiYuP%2B5c%2BrcEAAAOF0ftH%2BLC%2BzGoA7BoBt%2FqIl7gRoXgugdfeLZrIPQLUAoOna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jM8L3Bob3Rvc2hvcDpDb2xvck1vZGU%2BCiAgICAgICAgIDxwaG90b3Nob3A6SUNDUHJvZmlsZT5zUkdCIElFQzYxOTY2LTIuMTwvcGhvdG9zaG9wOklDQ1Byb2ZpbGU%2BCiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24%2BCiAgICAgICAgIDx0aWZmOlhSZXNvbHV0aW9uPjcyMDA5MC8xMDAwMDwvdGlmZjpYUmVzb2x1dGlvbj4KICAgICAgICAgPHRpZmY6WVJlc29sdXRpb24%2BNzIwMDkwLzEwMDAwPC90aWZmOllSZXNvbHV0aW9uPgogICAgICAgICA8dGlmZjpSZXNvbHV0aW9uVW5pdD4yPC90aWZmOlJlc29sdXRpb25Vbml0PgogICAgICAgICA8ZXhpZjpDb2xvclNwYWNlPjE8L2V4aWY6Q29sb3JTcGFjZT4KICAgICAgICAgPGV4aWY6UGl4ZWxYRGltZW5zaW9uPjI0PC9leGlmOlBpeGVsWERpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6UGl4ZWxZRGltZW5zaW9uPjI0PC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24%2BCiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE%2BCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw%2FeHBhY2tldCBlbmQ9InciPz4ykninAAAAIGNIUk0AAHolAACAgwAA%2Bf8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAYpSURBVHjafFZtTFvnFX7Oea%2BNudiY2Hwam4CBlgQwXdKREDKUoYg0jbRJ29RJ2VZ1mjRFUxSpA3VTfkzJfkQbS7spU6rtx5Z2UtppScjaHxvLuiatWi2jLEoMIUDCh23g2gbj7%2BtPuPvhOurawPl1dc99n%2Bc55z33fV46ceIEZFkGADAziAgAQERoe%2F9ZK4GPM%2FAcgbsIXAcABCgMvkfAqAa89eDoJyF8LogIqqqChoaGYDAYHr8kItS8uc8iIH6iAa9IkAo5EAQX8pqmgUVBCBggYFgDhv0%2FGAsBgKZpICJkMhnQ4OAgZFkGEYGZUXmp%2B0cS%2BCKBwWA0DVRPOg5Zl2q6zaHyJlnVAMQXVTkwHrUqH0Xsvn%2BtdQAAMQDgpPLS2MViFY8rkGUZzIzaS%2Ft%2FxqCzGggtz9e697zsnKhoLUtim4jOq%2FLE6x7X0nsh16dEZ5a%2FO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9eVjGyZzs%2Bw78Nqu0a2mbvVu1KEJQAgeZRL0liQYyx%2BGOmKeQpu0rMYsAJPNEFGD2dLodLIy6c9Ys7G8yeSUl3tf2%2FX3rcBVJSOv34l3sCBogi7z1LH%2FrBHjl4IJ93%2FncQFAnjeImJD0Z8zuCwu9q3djDXqTlAKID5xv%2B9t2R8n8VcUFBljQ8Gyfe40BYBM4DwDLt8Kue79ZcFkbzfEdbUbv%2BoN4c9KTtsfm1MbYQqqh%2B2zrVZYKs%2F7Ef%2Bbyimt1POYiJhDhPBFBIiIEXhxfs7%2FdfYoIF%2BauBfYTE%2Fpebx%2FV8hqBP2ODvD34yvuh%2FWCAmU75Bx6sIgaI%2Fv5%2B6PV6JLqUsYr7dpDAoehs0h73pHTWrvKgThYbRSt9UmSjef3MpaUvBz4O72UmADgTOPJguGiZor%2B%2FHyUlJWBmJFz%2BD8xTtlUiOpbwpmrmrweeSXrT%2Bg11k4SBN3RGKUcAVCVdFhyP1nreDbY%2F%2FNPyEXUlU%2FPp4XYycGT6V0Ux2WwWdO7cOZSWlkII8diX7SPPNgDaKdbxoNAxwATBAEkEEgSWCEQAqPAMwqvMdCEwMO0tVqZpWsGTT58%2BDaPR%2BPhGIYQAAAgh0P7B3ioW%2FB0iGiCGiwXbCuOHFSJys6AbYFye2T%2BxWhT3WYJEIoH%2FDQBMw3kes8OJPgAAAABJRU5ErkJggg%3D%3D%29%3B%0A%7D%0Adiv%2Evis%2Dnetwork%20div%2Evis%2Dedit%2Dmode%20div%2Evis%2Dbutton%2Evis%2Dedit%2Evis%2Dedit%2Dmode%20%7B%0Abackground%2Dcolor%3A%20%23fcfcfc%3B%0Aborder%3A%201px%20solid%20%23cccccc%3B%0A%7D%0Adiv%2Evis%2Dnetwork%20div%2Evis%2Dmanipulation%20div%2Evis%2Dbutton%2Evis%2Dconnect%20%7B%0Abackground%2Dimage%3A%20url%28data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAY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dXRpb25Vbml0PgogICAgICAgICA8ZXhpZjpDb2xvclNwYWNlPjE8L2V4aWY6Q29sb3JTcGFjZT4KICAgICAgICAgPGV4aWY6UGl4ZWxYRGltZW5zaW9uPjI0PC9leGlmOlBpeGVsWERpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6UGl4ZWxZRGltZW5zaW9uPjI0PC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24%2BCiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE%2BCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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x1dGlvbj4KICAgICAgICAgPHRpZmY6WVJlc29sdXRpb24%2BNzIwMDkwLzEwMDAwPC90aWZmOllSZXNvbHV0aW9uPgogICAgICAgICA8dGlmZjpSZXNvbHV0aW9uVW5pdD4yPC90aWZmOlJlc29sdXRpb25Vbml0PgogICAgICAgICA8ZXhpZjpDb2xvclNwYWNlPjE8L2V4aWY6Q29sb3JTcGFjZT4KICAgICAgICAgPGV4aWY6UGl4ZWxYRGltZW5zaW9uPjI0PC9leGlmOlBpeGVsWERpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6UGl4ZWxZRGltZW5zaW9uPjI0PC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24%2BCiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE%2BCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw%2FeHBhY2tldCBlbmQ9InciPz4aYJzYAAAAIGNIUk0AAHolAACAgwAA%2Bf8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAYGSURBVHjalJZ7UJTnFcZ%2F73m%2F72PdJY1RbhoQp6lkXRAvmIYxdCUadLVOozPNtGObap1JsKipjiShbdoRbeKEiQHpQK3xj0xa03aamTbaTGyAYV1QGeqFi%2BJyiZFLAlmESBkWRmS3fyzslGkmnZ5%2Fv%2FM873Oe75zzvqqoqAibzQaAiKCUAkApRdHIK%2FNFsx2NR91nOSILADDoJyzNaM4xxbtvPHh0iC%2BJiYkJ1OHDh4mJiUEpFSXPv%2FziPC28TIiXDCOSrAClQDSEpsCwJPIhrEBRQpiSytXlQwDhcBilFPfu3UMVFxdjt9ujFTzfcLBADCoEEAFr1ZbrrNjch2vtEImPBgHob7fTcWE%2BbVXJNJ%2FNiFQlEGLvieXHKmYqGB8fRx05cgSbzYaIsPvywV8pKFaA7fGtLTzz61YWpo%2FxVTHQbufsq5lcez9zWuWhk5mvFwMEg0H0%2BvXrMU2Tn1wp3CtCiQ5DjGd3A%2Fm%2Fv8IDCZP8r4iNmyRrWx%2Fj%2F5qktykZpXKzAjVDVxPzGqemptDr1q1jX3NRnIJarcDKK2hgR2ULXRfncv7UYv7xpovhnhiW5Mz%2BkefeSKO6LJ1A1xzEuk%2FOjm4mRibpuZaMZW3OCtRUND60NmiICCIUShisx7a2sLMiQn4s77uEQgIabnqdfHIlgT1%2FqQeg8vs5dHhdCNB1wYn3RIiC995j26stjAbsNH%2BYiZJCESnS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9mEpkD0C2dS8n8zOjqK9ng8WJZFU%2BJTjasGvaCNXPpvJBPoMlm0OoDNMfWVxONfWNSUPUZ7TUQ56tCZlPwSgMnJSVRpaSmxsbFE1raw82ZxAZZRQUiBYUKGp5UlOX2krBzmoUVjiIKhHge9rfPo%2BWcy3ZeXIYASgL1%2FX5RfMXMvj46OosrLy7HZbGitUUohIuzoem0RofALaOsghgWGjky0MiJTL8b0lOvI8hN1DKXKP0jd3TNTWDgcJhgMoo4ePYrD4Yi%2BKmaeLlprnrtXFo9h%2FAAlG1AqE8yFmBrC%2BjO0bgH9EVpO%2F1F2Dc5g%2F%2FOAsbEx%2Fj0Af%2BUSsQynL1UAAAAASUVORK5CYII%3D%29%3B%0A%7D%0A%0Adiv%2Evis%2Dnetwork%20div%2Evis%2Dmanipulation%20div%2Evis%2Dlabel%2C%0Adiv%2Evis%2Dnetwork%20div%2Evis%2Dedit%2Dmode%20div%2Evis%2Dlabel%20%7B%0Amargin%3A%200%200%200%2023px%3B%0Aline%2Dheight%3A%2025px%3B%0A%7D%0Adiv%2Evis%2Dnetwork%20div%2Evis%2Dmanipulation%20div%2Evis%2Dseparator%2Dline%20%7B%0Afloat%3Aleft%3B%0Adisplay%3Ainline%2Dblock%3B%0Awidth%3A1px%3B%0Aheight%3A21px%3B%0Abackground%2Dcolor%3A%20%23bdbdbd%3B%0Amargin%3A%200px%207px%200%2015px%3B%20%0A%7D%0A%0Adiv%2Evis%2Dnetwork%20div%2Evis%2Dnavigation%20div%2Evis%2Dbutton%20%7B%0Awidth%3A34px%3B%0Aheight%3A34px%3B%0A%2Dmoz%2Dborder%2Dradius%3A%2017px%3B%0Aborder%2Dradius%3A%2017px%3B%0Aposition%3Aabsolute%3B%0Adisplay%3Ainline%2Dblock%3B%0Abackground%2Dposition%3A%202px%202px%3B%0Abackground%2Drepeat%3Ano%2Drepeat%3B%0Acursor%3A%20pointer%3B%0A%2Dwebkit%2Dtouch%2Dcallout%3A%20none%3B%0A%2Dwebkit%2Duser%2Dselect%3A%20none%3B%0A%2Dkhtml%2Duser%2Dselect%3A%20none%3B%0A%2Dmoz%2Duser%2Dselect%3A%20none%3B%0A%2Dms%2Duser%2Dselect%3A%20none%3B%0Auser%2Dselect%3A%20none%3B%0A%7D%0Adiv%2Evis%2Dnetwork%20div%2Evis%2Dnavigation%20div%2Evis%2Dbutton%3Ahover%20%7B%0Abox%2Dshadow%3A%200%200%203px%203px%20rgba%2856%2C%20207%2C%2021%2C%200%2E30%29%3B%0A%7D%0Adiv%2Evis%2Dnetwork%20div%2Evis%2Dnavigation%20div%2Evis%2Dbutton%3Aactive%20%7B%0Abox%2Dshadow%3A%200%200%201px%203px%20rgba%2856%2C%20207%2C%2021%2C%200%2E95%29%3B%0A%7D%0Adiv%2Evis%2Dnetwork%20div%2Evis%2Dnavigation%20div%2Evis%2Dbutton%2Evis%2Dup%20%7B%0Abackground%2Dimage%3A%20url%28data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89%2BbN%2FrXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz%2FSMBAPh%2BPDwrIsAHvgABeNMLCADATZvAMByH%2Fw%2FqQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf%2BbTAICd%2BJl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmk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EgGOmeb3c8FxAfb9mdf2RzyGGv5MvU7QwuEySwKHFp%2Fc%2FM71zA%2F2F7b1RajnYdLAqMukMVu2YcfmDYE2MD7H%2B7%2FXlq6cRIJqm4zXM%2Bqd3TGjVBir43KSLlXjiELe5TsX%2B3%2FyW%2FST45PaAHbKmccWh12AP93JNZywj0kSABIobpiXRHjtZ6faout2tyZMadGLXBCxBcvl6NfaAz%2BtKdFmObpzWl2%2BtIIBACYy0t%2Fyj34M7HvsKUK%2BCGassvicX7alYDwwq%2BvykIEqPVa%2BQ9gdYk5%2BV%2BUE7lj3%2BFGbuBM%2FX5JUT8QwIVSSSZiTgmoFR2MfiqYFFPfjpkyrfWPopwxP47AP1pK1g9%2FdqeAAAAAElFTkSuQmCC%29%3B%0Abottom%3A50px%3B%0Aleft%3A55px%3B%0A%7D%0Adiv%2Evis%2Dnetwork%20div%2Evis%2Dnavigation%20div%2Evis%2Dbutton%2Evis%2Ddown%20%7B%0Abackground%2Dimage%3A%20url%28data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89%2BbN%2FrXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz%2FSMBAPh%2BPDwrIsAHvgABeNMLCADATZvAMByH%2Fw%2FqQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf%2BbTAICd%2BJl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAA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xtzdW4s%2BtI5HPBwQTTzziKY3v%2F7HGlhmS23g90T%2BOO5L1Nu7MMw3Fv%2FTx1f97%2FFnsAYPui8%2FD4nBB%2FoZZR230uoq67auQoLaB37Iio3sEAK52nR39p%2BzS13HFiilHeYtOOabdC71jQzz2R%2BALBbcrjWNF%2BcfaUwLSrk4KmtsT4T%2BgK9jG7AKKjv93X1lcfUNNVaantropqddnDCcIoa7lk29S92%2B%2F5CpOvQ04VJ79KUe%2F7iI%2FHh40U6c3PyuPjhmWKN8G8Fvnw1A%2FzmX%2FvV5h%2FT%2BCXstRMUp4kOFOjZiUlWBkFQYdALitRZXRzf3RqWumdgF79NQDBOa2V%2FiYSHAAAAABJRU5ErkJggg%3D%3D%29%3B%0Abottom%3A10px%3B%0Aright%3A55px%3B%0A%7D%0Adiv%2Evis%2Dnetwork%20div%2Evis%2Dnavigation%20div%2Evis%2Dbutton%2Evis%2DzoomExtends%20%7B%0Abackground%2Dimage%3A%20url%28data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89%2BbN%2FrXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz%2FSMBAPh%2BPDwrIsAHvgABeNMLCADATZvAMByH%2Fw%2FqQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf%2BbTAICd%2BJl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5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KlNM4lj24m%2BPf13o2wOVHqGA5MsAXjKPrDaqnMvlQnjTzhy0Nlw0d5oI5p3yN62amrk%2Bve5B5%2BhXgb47WGX52%2BV3NgoFOvQKAGUkkTqcbZy5XC7XHYf4zEFr3aXU7jih5uidPPOtvsmzixZr8VMrHjBHddLsHj%2BZ9Fb%2Fn9a1%2BT%2FJDaXey0IpEzEKkHnU8Jj79%2B%2BPeEwSSimQRGP%2BGz8j5DVFBVKQtjBj6JGlNt%2FD8Y%2BOpMdlTphiEqcB4tqtsVjfjUtLLkx0J%2FdOnjWPTg%2BlEARIEHwaQJVQIYggACC%2Fqxi6rn8ZHL4XETSsf0MU1HOk%2FCFGYgAwskUqY5eBitRxzn7%2Fa0V1EEBwdqkN6jPI7y4xPmHmC5unbWdQRMqP2d86qANOksU6gvmArNQRNClqABnQgYuK0krI%2BwCOAyH3DK%2FvqOXhaf3PAO7mIRjDNV25AAAAAElFTkSuQmCC%29%3B%0Abottom%3A50px%3B%0Aright%3A15px%3B%0A%7D%0A%2Evis%2Dtimeline%20%7B%0A%0A%7D%0A%2Evis%2Dpanel%20%7B%0A%0A%7D%0A%2Evis%2Daxis%20%7B%0A%0A%7D%0A%0A%2Evis%2Dcurrent%2Dtime%20%7B%0Abackground%2Dcolor%3A%20%23FF7F6E%3B%0Awidth%3A%202px%3B%0Az%2Dindex%3A%201%3B%0Apointer%2Devents%3A%20none%3B%0A%7D%0A%2Evis%2Drolling%2Dmode%2Dbtn%20%7B%0Aheight%3A%2040px%3B%0Awidth%3A%2040px%3B%0Aposition%3A%20absolute%3B%0Atop%3A%207px%3B%0Aright%3A%2020px%3B%0Aborder%2Dradius%3A%2050%25%3B%0Afont%2Dsize%3A%2028px%3B%0Acursor%3A%20pointer%3B%0Aopacity%3A%200%2E8%3B%0Acolor%3A%20white%3B%0Afont%2Dweight%3A%20bold%3B%0Atext%2Dalign%3A%20center%3B%0Abackground%3A%20%233876c2%3B%0A%7D%0A%2Evis%2Drolling%2Dmode%2Dbtn%3Abefore%20%7B%0Acontent%3A%20%22%5C26F6%22%3B%0A%7D%0A%2Evis%2Drolling%2Dmode%2Dbtn%3Ahover%20%7B%0Aopacity%3A%201%3B%0A%7D%0A%2Evis%2Dcustom%2Dtime%20%7B%0Abackground%2Dcolor%3A%20%236E94FF%3B%0Awidth%3A%202px%3B%0Acursor%3A%20move%3B%0Az%2Dindex%3A%201%3B%0A%7D%0A%2Evis%2Dpanel%2Evis%2Dbackground%2Evis%2Dhorizontal%20%2Evis%2Dgrid%2Evis%2Dhorizontal%20%7B%0Aposition%3A%20absolute%3B%0Awidth%3A%20100%25%3B%0Aheight%3A%200%3B%0Aborder%2Dbottom%3A%201px%20solid%3B%0A%7D%0A%2Evis%2Dpanel%2Evis%2Dbackground%2Evis%2Dhorizontal%20%2Evis%2Dgrid%2Evis%2Dminor%20%7B%0Aborder%2Dcolor%3A%20%23e5e5e5%3B%0A%7D%0A%2Evis%2Dpanel%2Evis%2Dbackground%2Evis%2Dhorizontal%20%2Evis%2Dgrid%2Evis%2Dmajor%20%7B%0Aborder%2Dcolor%3A%20%23bfbfbf%3B%0A%7D%0A%2Evis%2Ddata%2Daxis%20%2Evis%2Dy%2Daxis%2Evis%2Dmajor%20%7B%0Awidth%3A%20100%25%3B%0Aposition%3A%20absolute%3B%0Acolor%3A%20%234d4d4d%3B%0Awhite%2Dspace%3A%20nowrap%3B%0A%7D%0A%2Evis%2Ddata%2Daxis%20%2Evis%2Dy%2Daxis%2Evis%2Dmajor%2Evis%2Dmeasure%20%7B%0Apadding%3A%200%3B%0Amargin%3A%200%3B%0Aborder%3A%200%3B%0Avisibility%3A%20hidden%3B%0Awidth%3A%20auto%3B%0A%7D%0A%2Evis%2Ddata%2Daxis%20%2Evis%2Dy%2Daxis%2Evis%2Dminor%20%7B%0Aposition%3A%20absolute%3B%0Awidth%3A%20100%25%3B%0Acolor%3A%20%23bebebe%3B%0Awhite%2Dspace%3A%20nowrap%3B%0A%7D%0A%2Evis%2Ddata%2Daxis%20%2Evis%2Dy%2Daxis%2Evis%2Dminor%2Evis%2Dmeasure%20%7B%0Apadding%3A%200%3B%0Amargin%3A%200%3B%0Aborder%3A%200%3B%0Avisibility%3A%20hidden%3B%0Awidth%3A%20auto%3B%0A%7D%0A%2Evis%2Ddata%2Daxis%20%2Evis%2Dy%2Daxis%2Evis%2Dtitle%20%7B%0Aposition%3A%20absolute%3B%0Acolor%3A%20%234d4d4d%3B%0Awhite%2Dspace%3A%20nowrap%3B%0Abottom%3A%2020px%3B%0Atext%2Dalign%3A%20center%3B%0A%7D%0A%2Evis%2Ddata%2Daxis%20%2Evis%2Dy%2Daxis%2Evis%2Dtitle%2Evis%2Dmeasure%20%7B%0Apadding%3A%200%3B%0Amargin%3A%200%3B%0Avisibility%3A%20hidden%3B%0Awidth%3A%20auto%3B%0A%7D%0A%2Evis%2Ddata%2Daxis%20%2Evis%2Dy%2Daxis%2Evis%2Dtitle%2Evis%2Dleft%20%7B%0Abottom%3A%200%3B%0A%2Dwebkit%2Dtransform%2Dorigin%3A%20left%20top%3B%0A%2Dmoz%2Dtransform%2Dorigin%3A%20left%20top%3B%0A%2Dms%2Dtransform%2Dorigin%3A%20left%20top%3B%0A%2Do%2Dtransform%2Dorigin%3A%20left%20top%3B%0Atransform%2Dorigin%3A%20left%20bottom%3B%0A%2Dwebkit%2Dtransform%3A%20rotate%28%2D90deg%29%3B%0A%2Dmoz%2Dtransform%3A%20rotate%28%2D90deg%29%3B%0A%2Dms%2Dtransform%3A%20rotate%28%2D90deg%29%3B%0A%2Do%2Dtransform%3A%20rotate%28%2D90deg%29%3B%0Atransform%3A%20rotate%28%2D90deg%29%3B%0A%7D%0A%2Evis%2Ddata%2Daxis%20%2Evis%2Dy%2Daxis%2Evis%2Dtitle%2Evis%2Dright%20%7B%0Abottom%3A%200%3B%0A%2Dwebkit%2Dtransform%2Dorigin%3A%20right%20bottom%3B%0A%2Dmoz%2Dtransform%2Dorigin%3A%20right%20bottom%3B%0A%2Dms%2Dtransform%2Dorigin%3A%20right%20bottom%3B%0A%2Do%2Dtransform%2Dorigin%3A%20right%20bottom%3B%0Atransform%2Dorigin%3A%20right%20bottom%3B%0A%2Dwebkit%2Dtransform%3A%20rotate%2890deg%29%3B%0A%2Dmoz%2Dtransform%3A%20rotate%2890deg%29%3B%0A%2Dms%2Dtransform%3A%20rotate%2890deg%29%3B%0A%2Do%2Dtransform%3A%20rotate%2890deg%29%3B%0Atransform%3A%20rotate%2890deg%29%3B%0A%7D%0A%2Evis%2Dlegend%20%7B%0Abackground%2Dcolor%3A%20rgba%28247%2C%20252%2C%20255%2C%200%2E65%29%3B%0Apadding%3A%205px%3B%0Aborder%3A%201px%20solid%20%23b3b3b3%3B%0Abox%2Dshadow%3A%202px%202px%2010px%20rgba%28154%2C%20154%2C%20154%2C%200%2E55%29%3B%0A%7D%0A%2Evis%2Dlegend%2Dtext%20%7B%0A%0Awhite%2Dspace%3A%20nowrap%3B%0Adisplay%3A%20inline%2Dblock%0A%7D%0A%2Evis%2Ditem%20%7B%0Aposition%3A%20absolute%3B%0Acolor%3A%20%231A1A1A%3B%0Aborder%2Dcolor%3A%20%2397B0F8%3B%0Aborder%2Dwidth%3A%201px%3B%0Abackground%2Dcolor%3A%20%23D5DDF6%3B%0Adisplay%3A%20inline%2Dblock%3B%0Az%2Dindex%3A%201%3B%0A%0A%7D%0A%2Evis%2Ditem%2Evis%2Dselected%20%7B%0Aborder%2Dcolor%3A%20%23FFC200%3B%0Abackground%2Dcolor%3A%20%23FFF785%3B%0A%0Az%2Dindex%3A%202%3B%0A%7D%0A%2Evis%2Deditable%2Evis%2Dselected%20%7B%0Acursor%3A%20move%3B%0A%7D%0A%2Evis%2Ditem%2Evis%2Dpoint%2Evis%2Dselected%20%7B%0Abackground%2Dcolor%3A%20%23FFF785%3B%0A%7D%0A%2Evis%2Ditem%2Evis%2Dbox%20%7B%0Atext%2Dalign%3A%20center%3B%0Aborder%2Dstyle%3A%20solid%3B%0Aborder%2Dradius%3A%202px%3B%0A%7D%0A%2Evis%2Ditem%2Evis%2Dpoint%20%7B%0Abackground%3A%20none%3B%0A%7D%0A%2Evis%2Ditem%2Evis%2Ddot%20%7B%0Aposition%3A%20absolute%3B%0Apadding%3A%200%3B%0Aborder%2Dwidth%3A%204px%3B%0Aborder%2Dstyle%3A%20solid%3B%0Aborder%2Dradius%3A%204px%3B%0A%7D%0A%2Evis%2Ditem%2Evis%2Drange%20%7B%0Aborder%2Dstyle%3A%20solid%3B%0Aborder%2Dradius%3A%202px%3B%0Abox%2Dsizing%3A%20border%2Dbox%3B%0A%7D%0A%2Evis%2Ditem%2Evis%2Dbackground%20%7B%0Aborder%3A%20none%3B%0Abackground%2Dcolor%3A%20rgba%28213%2C%20221%2C%20246%2C%200%2E4%29%3B%0Abox%2Dsizing%3A%20border%2Dbox%3B%0Apadding%3A%200%3B%0Amargin%3A%200%3B%0A%7D%0A%2Evis%2Ditem%20%2Evis%2Ditem%2Doverflow%20%7B%0Aposition%3A%20relative%3B%0Awidth%3A%20100%25%3B%0Aheight%3A%20100%25%3B%0Apadding%3A%200%3B%0Amargin%3A%200%3B%0Aoverflow%3A%20hidden%3B%0A%7D%0A%2Evis%2Ditem%2Dvisible%2Dframe%20%7B%0Awhite%2Dspace%3A%20nowrap%3B%0A%7D%0A%2Evis%2Ditem%2Evis%2Drange%20%2Evis%2Ditem%2Dcontent%20%7B%0Aposition%3A%20relative%3B%0Adisplay%3A%20inline%2Dblock%3B%0A%7D%0A%2Evis%2Ditem%2Evis%2Dbackground%20%2Evis%2Ditem%2Dcontent%20%7B%0Aposition%3A%20absolute%3B%0Adisplay%3A%20inline%2Dblock%3B%0A%7D%0A%2Evis%2Ditem%2Evis%2Dline%20%7B%0Apadding%3A%200%3B%0Aposition%3A%20absolute%3B%0Awidth%3A%200%3B%0Aborder%2Dleft%2Dwidth%3A%201px%3B%0Aborder%2Dleft%2Dstyle%3A%20solid%3B%0A%7D%0A%2Evis%2Ditem%20%2Evis%2Ditem%2Dcontent%20%7B%0Awhite%2Dspace%3A%20nowrap%3B%0Abox%2Dsizing%3A%20border%2Dbox%3B%0Apadding%3A%205px%3B%0A%7D%0A%2Evis%2Ditem%20%2Evis%2DonUpdateTime%2Dtooltip%20%7B%0Aposition%3A%20absolute%3B%0Abackground%3A%20%234f81bd%3B%0Acolor%3A%20white%3B%0Awidth%3A%20200px%3B%0Atext%2Dalign%3A%20center%3B%0Awhite%2Dspace%3A%20nowrap%3B%0Apadding%3A%205px%3B%0Aborder%2Dradius%3A%201px%3B%0Atransition%3A%200%2E4s%3B%0A%2Do%2Dtransition%3A%200%2E4s%3B%0A%2Dmoz%2Dtransition%3A%200%2E4s%3B%0A%2Dwebkit%2Dtransition%3A%200%2E4s%3B%0A%7D%0A%2Evis%2Ditem%20%2Evis%2Ddelete%2C%20%2Evis%2Ditem%20%2Evis%2Ddelete%2Drtl%20%7B%0Aposition%3A%20absolute%3B%0Atop%3A%200px%3B%0Awidth%3A%2024px%3B%0Aheight%3A%2024px%3B%0Abox%2Dsizing%3A%20border%2Dbox%3B%0Apadding%3A%200px%205px%3B%0Acursor%3A%20pointer%3B%0A%2Dwebkit%2Dtransition%3A%20background%200%2E2s%20linear%3B%0A%2Dmoz%2Dtransition%3A%20background%200%2E2s%20linear%3B%0A%2Dms%2Dtransition%3A%20background%200%2E2s%20linear%3B%0A%2Do%2Dtransition%3A%20background%200%2E2s%20linear%3B%0Atransition%3A%20background%200%2E2s%20linear%3B%0A%7D%0A%2Evis%2Ditem%20%2Evis%2Ddelete%20%7B%0Aright%3A%20%2D24px%3B%0A%7D%0A%2Evis%2Ditem%20%2Evis%2Ddelete%2Drtl%20%7B%0Aleft%3A%20%2D24px%3B%0A%7D%0A%2Evis%2Ditem%20%2Evis%2Ddelete%3Aafter%2C%20%2Evis%2Ditem%20%2Evis%2Ddelete%2Drtl%3Aafter%20%7B%0Acontent%3A%20%22%5C00D7%22%3B%20%0Acolor%3A%20red%3B%0Afont%2Dfamily%3A%20arial%2C%20sans%2Dserif%3B%0Afont%2Dsize%3A%2022px%3B%0Afont%2Dweight%3A%20bold%3B%0A%2Dwebkit%2Dtransition%3A%20color%200%2E2s%20linear%3B%0A%2Dmoz%2Dtransition%3A%20color%200%2E2s%20linear%3B%0A%2Dms%2Dtransition%3A%20color%200%2E2s%20linear%3B%0A%2Do%2Dtransition%3A%20color%200%2E2s%20linear%3B%0Atransition%3A%20color%200%2E2s%20linear%3B%0A%7D%0A%2Evis%2Ditem%20%2Evis%2Ddelete%3Ahover%2C%20%2Evis%2Ditem%20%2Evis%2Ddelete%2Drtl%3Ahover%20%7B%0Abackground%3A%20red%3B%0A%7D%0A%2Evis%2Ditem%20%2Evis%2Ddelete%3Ahover%3Aafter%2C%20%2Evis%2Ditem%20%2Evis%2Ddelete%2Drtl%3Ahover%3Aafter%20%7B%0Acolor%3A%20white%3B%0A%7D%0A%2Evis%2Ditem%20%2Evis%2Ddrag%2Dcenter%20%7B%0Aposition%3A%20absolute%3B%0Awidth%3A%20100%25%3B%0Aheight%3A%20100%25%3B%0Atop%3A%200%3B%0Aleft%3A%200px%3B%0Acursor%3A%20move%3B%0A%7D%0A%2Evis%2Ditem%2Evis%2Drange%20%2Evis%2Ddrag%2Dleft%20%7B%0Aposition%3A%20absolute%3B%0Awidth%3A%2024px%3B%0Amax%2Dwidth%3A%2020%25%3B%0Amin%2Dwidth%3A%202px%3B%0Aheight%3A%20100%25%3B%0Atop%3A%200%3B%0Aleft%3A%20%2D4px%3B%0Acursor%3A%20w%2Dresize%3B%0A%7D%0A%2Evis%2Ditem%2Evis%2Drange%20%2Evis%2Ddrag%2Dright%20%7B%0Aposition%3A%20absolute%3B%0Awidth%3A%2024px%3B%0Amax%2Dwidth%3A%2020%25%3B%0Amin%2Dwidth%3A%202px%3B%0Aheight%3A%20100%25%3B%0Atop%3A%200%3B%0Aright%3A%20%2D4px%3B%0Acursor%3A%20e%2Dresize%3B%0A%7D%0A%2Evis%2Drange%2Evis%2Ditem%2Evis%2Dreadonly%20%2Evis%2Ddrag%2Dleft%2C%0A%2Evis%2Drange%2Evis%2Ditem%2Evis%2Dreadonly%20%2Evis%2Ddrag%2Dright%20%7B%0Acursor%3A%20auto%3B%0A%7D%0A%2Evis%2Ditemset%20%7B%0Aposition%3A%20relative%3B%0Apadding%3A%200%3B%0Amargin%3A%200%3B%0Abox%2Dsizing%3A%20border%2Dbox%3B%0A%7D%0A%2Evis%2Ditemset%20%2Evis%2Dbackground%2C%0A%2Evis%2Ditemset%20%2Evis%2Dforeground%20%7B%0Aposition%3A%20absolute%3B%0Awidth%3A%20100%25%3B%0Aheight%3A%20100%25%3B%0Aoverflow%3A%20visible%3B%0A%7D%0A%2Evis%2Daxis%20%7B%0Aposition%3A%20absolute%3B%0Awidth%3A%20100%25%3B%0Aheight%3A%200%3B%0Aleft%3A%200%3B%0Az%2Dindex%3A%201%3B%0A%7D%0A%2Evis%2Dforeground%20%2Evis%2Dgroup%20%7B%0Aposition%3A%20relative%3B%0Abox%2Dsizing%3A%20border%2Dbox%3B%0Aborder%2Dbottom%3A%201px%20solid%20%23bfbfbf%3B%0A%7D%0A%2Evis%2Dforeground%20%2Evis%2Dgroup%3Alast%2Dchild%20%7B%0Aborder%2Dbottom%3A%20none%3B%0A%7D%0A%2Evis%2Dnesting%2Dgroup%20%7B%0Acursor%3A%20pointer%3B%0A%7D%0A%2Evis%2Dnested%2Dgroup%20%7B%0Abackground%3A%20%23f5f5f5%3B%0A%7D%0A%2Evis%2Dlabel%2Evis%2Dnesting%2Dgroup%2Eexpanded%3Abefore%20%7B%0Acontent%3A%20%22%5C25BC%22%3B%0A%7D%0A%2Evis%2Dlabel%2Evis%2Dnesting%2Dgroup%2Ecollapsed%2Drtl%3Abefore%20%7B%0Acontent%3A%20%22%5C25C0%22%3B%0A%7D%0A%2Evis%2Dlabel%2Evis%2Dnesting%2Dgroup%2Ecollapsed%3Abefore%20%7B%0Acontent%3A%20%22%5C25B6%22%3B%0A%7D%0A%2Evis%2Doverlay%20%7B%0Aposition%3A%20absolute%3B%0Atop%3A%200%3B%0Aleft%3A%200%3B%0Awidth%3A%20100%25%3B%0Aheight%3A%20100%25%3B%0Az%2Dindex%3A%2010%3B%0A%7D%0A%2Evis%2Dlabelset%20%7B%0Aposition%3A%20relative%3B%0Aoverflow%3A%20hidden%3B%0Abox%2Dsizing%3A%20border%2Dbox%3B%0A%7D%0A%2Evis%2Dlabelset%20%2Evis%2Dlabel%20%7B%0Aposition%3A%20relative%3B%0Aleft%3A%200%3B%0Atop%3A%200%3B%0Awidth%3A%20100%25%3B%0Acolor%3A%20%234d4d4d%3B%0Abox%2Dsizing%3A%20border%2Dbox%3B%0A%7D%0A%2Evis%2Dlabelset%20%2Evis%2Dlabel%20%7B%0Aborder%2Dbottom%3A%201px%20solid%20%23bfbfbf%3B%0A%7D%0A%2Evis%2Dlabelset%20%2Evis%2Dlabel%2Edraggable%20%7B%0Acursor%3A%20pointer%3B%0A%7D%0A%2Evis%2Dlabelset%20%2Evis%2Dlabel%3Alast%2Dchild%20%7B%0Aborder%2Dbottom%3A%20none%3B%0A%7D%0A%2Evis%2Dlabelset%20%2Evis%2Dlabel%20%2Evis%2Dinner%20%7B%0Adisplay%3A%20inline%2Dblock%3B%0Apadding%3A%205px%3B%0A%7D%0A%2Evis%2Dlabelset%20%2Evis%2Dlabel%20%2Evis%2Dinner%2Evis%2Dhidden%20%7B%0Apadding%3A%200%3B%0A%7D%0A%2Evis%2Dpanel%20%7B%0Aposition%3A%20absolute%3B%0Apadding%3A%200%3B%0Amargin%3A%200%3B%0Abox%2Dsizing%3A%20border%2Dbox%3B%0A%7D%0A%2Evis%2Dpanel%2Evis%2Dcenter%2C%0A%2Evis%2Dpanel%2Evis%2Dleft%2C%0A%2Evis%2Dpanel%2Evis%2Dright%2C%0A%2Evis%2Dpanel%2Evis%2Dtop%2C%0A%2Evis%2Dpanel%2Evis%2Dbottom%20%7B%0Aborder%3A%201px%20%23bfbfbf%3B%0A%7D%0A%2Evis%2Dpanel%2Evis%2Dcenter%2C%0A%2Evis%2Dpanel%2Evis%2Dleft%2C%0A%2Evis%2Dpanel%2Evis%2Dright%20%7B%0Aborder%2Dtop%2Dstyle%3A%20solid%3B%0Aborder%2Dbottom%2Dstyle%3A%20solid%3B%0Aoverflow%3A%20hidden%3B%0A%7D%0A%2Evis%2Dleft%2Evis%2Dpanel%2Evis%2Dvertical%2Dscroll%2C%20%2Evis%2Dright%2Evis%2Dpanel%2Evis%2Dvertical%2Dscroll%20%7B%0Aheight%3A%20100%25%3B%0Aoverflow%2Dx%3A%20hidden%3B%0Aoverflow%2Dy%3A%20scroll%3B%0A%7D%20%2Evis%2Dleft%2Evis%2Dpanel%2Evis%2Dvertical%2Dscroll%20%7B%0Adirection%3A%20rtl%3B%0A%7D%0A%2Evis%2Dleft%2Evis%2Dpanel%2Evis%2Dvertical%2Dscroll%20%2Evis%2Dcontent%20%7B%0Adirection%3A%20ltr%3B%0A%7D%0A%2Evis%2Dright%2Evis%2Dpanel%2Evis%2Dvertical%2Dscroll%20%7B%0Adirection%3A%20ltr%3B%0A%7D%0A%2Evis%2Dright%2Evis%2Dpanel%2Evis%2Dvertical%2Dscroll%20%2Evis%2Dcontent%20%7B%0Adirection%3A%20rtl%3B%0A%7D%0A%2Evis%2Dpanel%2Evis%2Dcenter%2C%0A%2Evis%2Dpanel%2Evis%2Dtop%2C%0A%2Evis%2Dpanel%2Evis%2Dbottom%20%7B%0Aborder%2Dleft%2Dstyle%3A%20solid%3B%0Aborder%2Dright%2Dstyle%3A%20solid%3B%0A%7D%0A%2Evis%2Dbackground%20%7B%0Aoverflow%3A%20hidden%3B%0A%7D%0A%2Evis%2Dpanel%20%3E%20%2Evis%2Dcontent%20%7B%0Aposition%3A%20relative%3B%0A%7D%0A%2Evis%2Dpanel%20%2Evis%2Dshadow%20%7B%0Aposition%3A%20absolute%3B%0Awidth%3A%20100%25%3B%0Aheight%3A%201px%3B%0Abox%2Dshadow%3A%200%200%2010px%20rgba%280%2C0%2C0%2C0%2E8%29%3B%0A%0A%7D%0A%2Evis%2Dpanel%20%2Evis%2Dshadow%2Evis%2Dtop%20%7B%0Atop%3A%20%2D1px%3B%0Aleft%3A%200%3B%0A%7D%0A%2Evis%2Dpanel%20%2Evis%2Dshadow%2Evis%2Dbottom%20%7B%0Abottom%3A%20%2D1px%3B%0Aleft%3A%200%3B%0A%7D%0A%2Evis%2Dgraph%2Dgroup0%20%7B%0Afill%3A%234f81bd%3B%0Afill%2Dopacity%3A0%3B%0Astroke%2Dwidth%3A2px%3B%0Astroke%3A%20%234f81bd%3B%0A%7D%0A%2Evis%2Dgraph%2Dgroup1%20%7B%0Afill%3A%23f79646%3B%0Afill%2Dopacity%3A0%3B%0Astroke%2Dwidth%3A2px%3B%0Astroke%3A%20%23f79646%3B%0A%7D%0A%2Evis%2Dgraph%2Dgroup2%20%7B%0Afill%3A%20%238c51cf%3B%0Afill%2Dopacity%3A0%3B%0Astroke%2Dwidth%3A2px%3B%0Astroke%3A%20%238c51cf%3B%0A%7D%0A%2Evis%2Dgraph%2Dgroup3%20%7B%0Afill%3A%20%2375c841%3B%0Afill%2Dopacity%3A0%3B%0Astroke%2Dwidth%3A2px%3B%0Astroke%3A%20%2375c841%3B%0A%7D%0A%2Evis%2Dgraph%2Dgroup4%20%7B%0Afill%3A%20%23ff0100%3B%0Afill%2Dopacity%3A0%3B%0Astroke%2Dwidth%3A2px%3B%0Astroke%3A%20%23ff0100%3B%0A%7D%0A%2Evis%2Dgraph%2Dgroup5%20%7B%0Afill%3A%20%2337d8e6%3B%0Afill%2Dopacity%3A0%3B%0Astroke%2Dwidth%3A2px%3B%0Astroke%3A%20%2337d8e6%3B%0A%7D%0A%2Evis%2Dgraph%2Dgroup6%20%7B%0Afill%3A%20%23042662%3B%0Afill%2Dopacity%3A0%3B%0Astroke%2Dwidth%3A2px%3B%0Astroke%3A%20%23042662%3B%0A%7D%0A%2Evis%2Dgraph%2Dgroup7%20%7B%0Afill%3A%2300ff26%3B%0Afill%2Dopacity%3A0%3B%0Astroke%2Dwidth%3A2px%3B%0Astroke%3A%20%2300ff26%3B%0A%7D%0A%2Evis%2Dgraph%2Dgroup8%20%7B%0Afill%3A%23ff00ff%3B%0Afill%2Dopacity%3A0%3B%0Astroke%2Dwidth%3A2px%3B%0Astroke%3A%20%23ff00ff%3B%0A%7D%0A%2Evis%2Dgraph%2Dgroup9%20%7B%0Afill%3A%20%238f3938%3B%0Afill%2Dopacity%3A0%3B%0Astroke%2Dwidth%3A2px%3B%0Astroke%3A%20%238f3938%3B%0A%7D%0A%2Evis%2Dtimeline%20%2Evis%2Dfill%20%7B%0Afill%2Dopacity%3A0%2E1%3B%0Astroke%3A%20none%3B%0A%7D%0A%2Evis%2Dtimeline%20%2Evis%2Dbar%20%7B%0Afill%2Dopacity%3A0%2E5%3B%0Astroke%2Dwidth%3A1px%3B%0A%7D%0A%2Evis%2Dtimeline%20%2Evis%2Dpoint%20%7B%0Astroke%2Dwidth%3A2px%3B%0Afill%2Dopacity%3A1%2E0%3B%0A%7D%0A%2Evis%2Dtimeline%20%2Evis%2Dlegend%2Dbackground%20%7B%0Astroke%2Dwidth%3A1px%3B%0Afill%2Dopacity%3A0%2E9%3B%0Afill%3A%20%23ffffff%3B%0Astroke%3A%20%23c2c2c2%3B%0A%7D%0A%2Evis%2Dtimeline%20%2Evis%2Doutline%20%7B%0Astroke%2Dwidth%3A1px%3B%0Afill%2Dopacity%3A1%3B%0Afill%3A%20%23ffffff%3B%0Astroke%3A%20%23e5e5e5%3B%0A%7D%0A%2Evis%2Dtimeline%20%2Evis%2Dicon%2Dfill%20%7B%0Afill%2Dopacity%3A0%2E3%3B%0Astroke%3A%20none%3B%0A%7D%0A%2Evis%2Dtime%2Daxis%20%7B%0Aposition%3A%20relative%3B%0Aoverflow%3A%20hidden%3B%0A%7D%0A%2Evis%2Dtime%2Daxis%2Evis%2Dforeground%20%7B%0Atop%3A%200%3B%0Aleft%3A%200%3B%0Awidth%3A%20100%25%3B%0A%7D%0A%2Evis%2Dtime%2Daxis%2Evis%2Dbackground%20%7B%0Aposition%3A%20absolute%3B%0Atop%3A%200%3B%0Aleft%3A%200%3B%0Awidth%3A%20100%25%3B%0Aheight%3A%20100%25%3B%0A%7D%0A%2Evis%2Dtime%2Daxis%20%2Evis%2Dtext%20%7B%0Aposition%3A%20absolute%3B%0Acolor%3A%20%234d4d4d%3B%0Apadding%3A%203px%3B%0Aoverflow%3A%20hidden%3B%0Abox%2Dsizing%3A%20border%2Dbox%3B%0Awhite%2Dspace%3A%20nowrap%3B%0A%7D%0A%2Evis%2Dtime%2Daxis%20%2Evis%2Dtext%2Evis%2Dmeasure%20%7B%0Aposition%3A%20absolute%3B%0Apadding%2Dleft%3A%200%3B%0Apadding%2Dright%3A%200%3B%0Amargin%2Dleft%3A%200%3B%0Amargin%2Dright%3A%200%3B%0Avisibility%3A%20hidden%3B%0A%7D%0A%2Evis%2Dtime%2Daxis%20%2Evis%2Dgrid%2Evis%2Dvertical%20%7B%0Aposition%3A%20absolute%3B%0Aborder%2Dleft%3A%201px%20solid%3B%0A%7D%0A%2Evis%2Dtime%2Daxis%20%2Evis%2Dgrid%2Evis%2Dvertical%2Drtl%20%7B%0Aposition%3A%20absolute%3B%0Aborder%2Dright%3A%201px%20solid%3B%0A%7D%0A%2Evis%2Dtime%2Daxis%20%2Evis%2Dgrid%2Evis%2Dminor%20%7B%0Aborder%2Dcolor%3A%20%23e5e5e5%3B%0A%7D%0A%2Evis%2Dtime%2Daxis%20%2Evis%2Dgrid%2Evis%2Dmajor%20%7B%0Aborder%2Dcolor%3A%20%23bfbfbf%3B%0A%7D%0A%2Evis%2Dtimeline%20%7B%0Aposition%3A%20relative%3B%0Aborder%3A%201px%20solid%20%23bfbfbf%3B%0Aoverflow%3A%20hidden%3B%0Apadding%3A%200%3B%0Amargin%3A%200%3B%0Abox%2Dsizing%3A%20border%2Dbox%3B%0A%7D%0A" rel="stylesheet" />
<script src="data:application/x-javascript;base64,LyoqDQogKiB2aXMuanMNCiAqIGh0dHBzOi8vZ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Gl0bGU6e3RleHQ6e3N0cmluZzppLG51bWJlcjpuLHVuZGVmaW5lZDoidW5kZWZpbmVkIn0sc3R5bGU6e3N0cmluZzppLHVuZGVmaW5lZDoidW5kZWZpbmVkIn0sX190eXBlX186e29iamVjdDpzfX0sX190eXBlX186e29iamVjdDpzfX0scmlnaHQ6e3JhbmdlOnttaW46e251bWJlcjpuLHVuZGVmaW5lZDoidW5kZWZpbmVkIn0sbWF4OntudW1iZXI6bix1bmRlZmluZWQ6InVuZGVmaW5lZCJ9LF9fdHlwZV9fOntvYmplY3Q6c319LGZvcm1hdDp7ZnVuY3Rpb246ImZ1bmN0aW9uIn0sdGl0bGU6e3RleHQ6e3N0cmluZzppLG51bWJlcjpuLHVuZGVmaW5lZDoidW5kZWZpbmVkIn0sc3R5bGU6e3N0cmluZzppLHVuZGVmaW5lZDoidW5kZWZpbmVkIn0sX190eXBlX186e29iamVjdDpzfX0sX190eXBlX186e29iamVjdDpzfX0sX190eXBlX186e29iamVjdDpzfX0sbGVnZW5kOntlbmFibGVkOntib29sZWFuOm99LGljb25zOntib29sZWFuOm99LGxlZnQ6e3Zpc2libGU6e2Jvb2xlYW46b30scG9zaXRpb246e3N0cmluZzpbInRvcC1yaWdodCIsImJvdHRvbS1yaWdodCIsInRvcC1sZWZ0IiwiYm90dG9tLWxlZnQiXX0sX190eXBlX186e29iamVjdDpzfX0scmlnaHQ6e3Zpc2libGU6e2Jvb2xlYW46b30scG9zaXRpb246e3N0cmluZzpbInRvcC1yaWdodCIsImJvdHRvbS1yaWdodCIsInRvcC1sZWZ0IiwiYm90dG9tLWxlZnQiXX0sX190eXBlX186e29iamVjdDpzfX0sX190eXBlX186e29iamVjdDpzLGJvb2xlYW46b319LGdyb3Vwczp7dmlzaWJpbGl0eTp7YW55OiJhbnkifSxfX3R5cGVfXzp7b2JqZWN0OnN9fSxhdXRvUmVzaXplOntib29sZWFuOm99LHRocm90dGxlUmVkcmF3OntudW1iZXI6bn0sY2xpY2tUb1VzZTp7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ICAgIH07DQogICAgdmFyIHRvSW50ZWdlciA9IGZ1bmN0aW9uICh2YWx1ZSkgeyANCiAgICAgIHZhciBudW1iZXIgPSBOdW1iZXIodmFsdWUpOyANCiAgICAgIGlmIChpc05hTihudW1iZXIpKSB7IHJldHVybiAwOyB9DQogICAgICBpZiAobnVtYmVyID09PSAwIHx8ICFpc0Zpbml0ZShudW1iZXIpKSB7IHJldHVybiBudW1iZXI7IH0NCiAgICAgIHJldHVybiAobnVtYmVyID4gMCA/IDEgOiAtMSkgKiBNYXRoLmZsb29yKE1hdGguYWJzKG51bWJlcikpOyANCiAgICB9Ow0KICAgIHZhciBtYXhTYWZlSW50ZWdlciA9IE1hdGgucG93KDIsIDUzKSAtIDE7DQogICAgdmFyIHRvTGVuZ3RoID0gZnVuY3Rpb24gKHZhbHVlKSB7IA0KICAgICAgdmFyIGxlbiA9IHRvSW50ZWdlcih2YWx1ZSk7DQogICAgICByZXR1cm4gTWF0aC5taW4oTWF0aC5tYXgobGVuLCAwKSwgbWF4U2FmZUludGVnZXIpOw0KICAgIH07IA0KICANCiAgICAvLyBMYSBwcm9wcmnDqXTDqSBsZW5ndGggZGUgbGEgbcOpdGhvZGUgdmF1dCAxLg0KICAgIHJldHVybiBmdW5jdGlvbiBmcm9tKGFycmF5TGlrZS8qLCBtYXBGbiwgdGhpc0FyZyAqLykgeyANCiAgICAgIC8vIDEuIFNvaXQgQywgbGEgdmFsZXVyIHRoaXMNCiAgICAgIHZhciBDID0gdGhpczsNCiAgICAgIA0KICAgICAgLy8gMi4gU29pdCBpdGVtcyBsZSBUb09iamVjdChhcnJheUxpa2UpLg0KICAgICAgdmFyIGl0ZW1zID0gT2JqZWN0KGFycmF5TGlrZSk7IA0KICAgICAgDQogICAgICAvLyAzLiBSZXR1cm5JZkFicnVwdChpdGVtcykuDQogICAgICBpZiAoYXJyYXlMaWtlID09IG51bGwpIHsgDQogICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoIkFycmF5LmZyb20gZG9p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NCiAgICAgICAgaWYob3B0aW9ucy5ub2RlcyAhPT0gdW5kZWZpbmVkKXsNCiAgICAgICAgICBpZihvcHRpb25zLm5vZGVzLnNoYXBlICE9PSB1bmRlZmluZWQpew0KICAgICAgICAgICAgc2hhcGVfb3B0aW9ucyA9IHRydWU7DQogICAgICAgICAgfQ0KICAgICAgICB9DQogICAgICAgIC8vIHNldCBmaW5hbCBzaGFwZSAoaW5kaXZpZHVhbCA+IGdyb3VwID4gZ2xvYmFsKQ0KICAgICAgICBpZihub2RlLm9wdGlvbnMuaGlkZGVuSW1hZ2UgIT09IHVuZGVmaW5lZCl7DQogICAgICAgICAgZmluYWxfc2hhcGUgPSBub2RlLm9wdGlvbnMuaGlkZGVuSW1hZ2U7DQogICAgICAgIH0gZWxzZSBpZihub2RlLm9wdGlvbnMuc2hhcGUgIT09IHVuZGVmaW5lZCl7DQogICAgICAgICAgZmluYWxfc2hhcGUgPSBub2RlLm9wdGlvbnMuc2hhcGU7DQogICAgICAgIH0gZWxzZSBpZihzaGFwZV9ncm91cCl7DQogICAgICAgICAgZmluYWxfc2hhcGUgPSBncm91cHMuZ3JvdXBzW25vZGUub3B0aW9ucy5ncm91cF0uc2hhcGU7DQogICAgICAgIH0gZWxzZSBpZihzaGFwZV9vcHRpb25zKXsNCiAgICAgICAgICBmaW5hbF9zaGFwZSA9IG9wdGlvbnMubm9kZXMuc2hhcGU7DQogICAgICAgIH0NCiAgICAgICAgDQogICAgICAgIG5vZGUuc2V0T3B0aW9ucyh7Ym9keUhpZGRlbkNvbG9yIDogbmV0d29yay5ib2R5Lm5vZGVzW25vZGUuaWRdLm9wdGlvbnMuY29sb3J9KTsNCiAgICAgICAgLy8gYW5kIGNhbGwgZ29vZCByZXNldCBmdW5jdGlvbg0KICAgICAgICBpZihmaW5hbF9zaGFwZSA9PT0gImljb24iKXsNCiAgICAgICAgICBzaW1wbGVJY29uUmVzZXROb2RlKG5vZGUsICJjbHVzdGVyIik7DQogICAgICAgIH0gZWxzZS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gICAgIHZhciBpc19ncm91cCA9IGZhbHNlOw0KICAJICAvLyBoYXZlIGEgZ3JvdXAgaW5mb3JtYXRpb24gJiBhIHNoYXBlIGRlZmluZWQgaW4gZ3JvdXAgPw0KICAgICAgICBpZihub2RlLmdyb3VwICE9PSB1bmRlZmluZWQpew0KICAgICAgICAgIGlmKGdyb3Vwcy5ncm91cHNbbm9kZS5ncm91cF0gIT09IHVuZGVmaW5lZCl7DQogICAgICAgICAgICBpc19ncm91cCA9IHRydWU7DQogICAgICAgICAgICBpZihncm91cHMuZ3JvdXBzW25vZGUuZ3JvdXBdLnNoYXBlICE9PSB1bmRlZmluZWQpew0KICAgICAgICAgICAgICBzaGFwZV9ncm91cCA9IHRydWU7DQogICAgICAgICAgICB9DQogICAgICAgICAgfQ0KICAgICAgICB9DQogICAgICAgIC8vIGhhdmUgYSBnbG9iYWwgc2hhcGUgaW4gbm9kZXMgb3B0aW9ucyA/DQogICAgICAgIHZhciBzaGFwZV9vcHRpb25zID0gZmFsc2U7DQogICAgICAgIGlmKG9wdGlvbnMubm9kZXMgIT09IHVuZGVmaW5lZCl7DQogICAgICAgICAgaWYob3B0aW9ucy5ub2Rlcy5zaGFwZSAhPT0gdW5kZWZpbmVkKXsNCiAgICAgICAgICAgIHNoYXBlX29wdGlvbnMgPSB0cnVlOw0KICAgICAgICAgIH0NCiAgICAgICAgfQ0KICAgICAgICAvLyBzZXQgZmluYWwgc2hhcGUgKGluZGl2aWR1YWwgPiBncm91cCA+IGdsb2JhbCkNCiAgICAgICAgaWYobm9kZS5oaWRkZW5JbWFnZSAhPT0gdW5kZWZpbmVkKXsNCiAgICAgICAgICBmaW5hbF9zaGFwZSA9IG5vZGUuaGlkZGVuSW1hZ2U7DQogICAgICAgIH0gZWxzZSBpZihub2RlLnNoYXBlICE9PSB1bmRlZmluZWQpew0KICAgICAgICAgIGZpbmFsX3NoYXBlID0gbm9kZS5zaGFwZTsNCiAgICAgICAgfSBlbHNlIGlmKHNoYXBlX2dyb3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Rpb25zLmNvbG9yKTsNCiAgICB9IGVsc2Ugew0KICAgICAgbm9kZS5zZXRPcHRpb25zKHtib2R5SGlkZGVuQ29sb3IgOiBjbG9uZShuZXR3b3JrLmJvZHkubm9kZXNbbm9kZS5pZF0ub3B0aW9ucy5jb2xvcil9KTsNCiAgICB9DQogIA0KICAgIC8vIGFuZCBjYWxsIGdvb2QgZnVuY3Rpb24NCiAgICBpZihmaW5hbF9zaGFwZSA9PT0gImljb24iKXsNCiAgICAgIC8vIGZpbmQgY29sb3IgZm9yIGljb24NCiAgICAgIHZhciBpY29uX2NvbG9yID0gIiMyQjdDRTkiOw0KICAgICAgdmFyIGZpbmRfY29sb3IgPSBmYWxzZTsNCiAgICAgIC8vIGluIG5vZGVzID8NCiAgICAgIGlmKG5vZGUuaWNvbiAhPT0gdW5kZWZpbmVkKXsNCiAgICAgICAgaWYobm9kZS5pY29uLmNvbG9yICE9PSB1bmRlZmluZWQpew0KICAgICAgICAgIGljb25fY29sb3IgPSBub2RlLmljb24uY29sb3I7DQogICAgICAgICAgZmluZF9jb2xvciA9IHRydWU7DQogICAgICAgIH0NCiAgICAgIH0gDQogICAgICAvLyBvciBpbiBncm91cCA/DQogICAgICBpZihmaW5kX2NvbG9yID09PSBmYWxzZSAmJiBpc19ncm91cCAmJiBncm91cHMuZ3JvdXBzW25vZGUuZ3JvdXBdLmljb24gIT09IHVuZGVmaW5lZCl7DQogICAgICAgIGlmKGdyb3Vwcy5ncm91cHNbbm9kZS5ncm91cF0uaWNvbi5jb2xvciAhPT0gdW5kZWZpbmVkKXsNCiAgICAgICAgICBpY29uX2NvbG9yID0gZ3JvdXBzLmdyb3Vwc1tub2RlLmdyb3VwXS5pY29uLmNvbG9yOw0KICAgICAgICAgIGZpbmRfY29sb3IgPSB0cnVlOw0KICAgICAgICB9DQogICAgICB9DQogICAgICAvLyBpbiBnbG9iYWwgbm9kZSA/DQogICAgICBpZihmaW5kX2NvbG9yID09PSBmYWxzZSAmJiBvcHRpb25zLm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giLCAic2NhbGluZyIsICJjaG9zZW4iLCAid2lkdGhDb25zdHJhaW50Il07DQogIA0KICB2YXIgbmFtZXMgPSBbXTsNCiAgdmFyIGNvbG5hbWVzID0gW107DQogIHZhciBsZW5ndGg7DQogIHZhciB0b2N0cmw7DQogIHZhciBjdHJsbmFtZTsNCiAgDQogIGZvciAodmFyIG5hbWUgaW4gZGYpIHsNCiAgICBpZiAoZGYuaGFzT3duUHJvcGVydHkobmFtZSkpDQogICAgICBjb2xuYW1lcy5wdXNoKG5hbWUpOw0KICAgICAgY3RybG5hbWUgPSBuYW1lLnNwbGl0KCIuIik7DQogICAgICBpZihjdHJsbmFtZS5sZW5ndGggPT09IDEpew0KICAgICAgICBuYW1lcy5wdXNoKCBuZXcgQXJyYXkobmFtZSkpOw0KICAgICAgfSBlbHNlIHsNCiAgICAgICAgaWYodHlwZSA9PT0gIm5vZGVzIil7DQogICAgICAgICB0b2N0cmwgPSBpbmRleE9mLmNhbGwobm9kZXNjdHJsLCBjdHJsbmFtZVswXSwgdHJ1ZSk7DQogICAgICAgIH0gZWxzZSBpZih0eXBlID09PSAiZWRnZXMiKXsNCiAgICAgICAgIHRvY3RybCA9IGluZGV4T2YuY2FsbChlZGdlc2N0cmwsIGN0cmxuYW1lWzBdLCB0cnVlKTsNCiAgICAgICAgfQ0KICAgICAgICBpZih0b2N0cmwgPiAtMSl7DQogICAgICAgICAgbmFtZXMucHVzaChjdHJsbmFtZSk7DQogICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgbmFtZXMucHVzaChuZXcgQXJyYXkobmFtZSkpOw0KICAgICAgICB9DQogICAgICB9DQogICAgICBpZiAodHlwZW9mKGRmW25hbWVdKSAhPT0gIm9iamVjdCIgfHwgdHlwZW9mKGRmW25hbWVdLmxlbmd0aCkgPT09ICJ1bmRlZmluZWQiKSB7DQogICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCJBbGwgZmllbGRzIG11c3QgYmUgYXJyYXlzIik7DQogICAgICB9IGVsc2UgaWYgKHR5cGVvZihsZW5ndGgpICE9PSAidW5kZWZpbmVkIiAmJiBsZW5ndGggIT09IGRmW25hbWVdLmxlbmd0aCkgew0KICAgICAgICAgIHRocm93IG5ldyBFcnJvcigiQWxsIGZpZWxkcyBtdXN0IGJlIGFycmF5cyBvZiB0aGUgc2FtZSBsZW5ndGgiKTsNCiAgICAgIH0NCiAgICAgIGxlbmd0aCA9IGRmW25hbWVdLmxlbmd0aDsNCiAgfQ0KDQogIHZhciByZXN1bHRzID0gW107DQogIHZhciBpdGVtOw0KICAgIGZvciAodmFyIHJvdyA9IDA7IHJvdyA8IGxlbmd0aDsgcm93KyspIHsNCiAgICAgIGl0ZW0gPSB7fTsNCiAgICAgIGZvciAodmFyIGNvbCA9IDA7IGNvbCA8IG5hbWVzLmxlbmd0aDsgY29sKyspIHsNCiAgICAgICAgaWYoZGZbY29sbmFtZXNbY29sXV1bcm93XSAhPT0gbnVsbCl7DQogICAgICAgICAgaWYobmFtZXNbY29sXS5sZW5ndGggPT09IDEpew0KICAgICAgICAgICAgaWYobmFtZXNbY29sXVswXSA9PT0gImRhc2hlcyIpew0KICAgICAgICAgICAgICBpdGVtW25hbWVzW2NvbF1dID0gZXZhbChkZltjb2xuYW1lc1tjb2xdXVtyb3ddKTsNCiAgICAgICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICAgIGl0ZW1bbmFtZXNbY29sXV0gPSBkZltjb2xuYW1lc1tjb2xdXVtyb3ddOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgIH0gZWxzZSBpZihuYW1lc1tjb2xdLmxlbmd0aCA9PT0gMil7DQogICAgICAgICAgICBpZihpdGVtW25hbWVzW2NvbF1bMF1dID09PSB1bmRlZmluZWQpew0KICAgICAgICAgICAgICBpdGVtW25hbWVzW2NvbF1bMF1dID0ge307DQogICAgICAgICAgICB9DQogICAgICAgICAgICBpZihuYW1lc1tjb2xdWzBdID09PSAiaWNvbiIgJiYgbmFtZXNbY29sXVsxXSA9PT0gImN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NCgkJaWYgKHR5cGVvZiB0YXJnZXRba10gPT09ICdvYmplY3QnICYmIGsgIT09ICJjb250YWluZXIiKSB7DQoJCQlzb3VyY2Vba10gPSBzb3VyY2Vba10gfHwge307DQoJCQl1cGRhdGUoc291cmNlW2tdLCB0YXJnZXRba10pOw0KCQl9IGVsc2Ugew0KCQkJc291cmNlW2tdID0gdGFyZ2V0W2tdOw0KCQl9DQoJfSk7DQp9DQovLyBmb3IgZmluZCBlbGVtZW50DQpmdW5jdGlvbiBpbmRleE9mKG5lZWRsZSwgc3RyKSB7DQogICAgICAgIGluZGV4T2YgPSBmdW5jdGlvbihuZWVkbGUsIHN0cikgew0KICAgICAgICAgICAgdmFyIGkgPSAtMSwgaW5kZXggPSAtMTsNCiAgICAgICAgICAgIGlmKHN0cil7DQogICAgICAgICAgICAgICAgICBuZWVkbGUgPSAnJytuZWVkbGU7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBmb3IoaSA9IDA7IGkgPCB0aGlzLmxlbmd0aDsgaSsrKSB7DQogICAgICAgICAgICAgICAgdmFyIHZhbCA9IHRoaXNbaV07DQogICAgICAgICAgICAgICAgaWYoc3RyKXsNCiAgICAgICAgICAgICAgICAgIHZhbCA9ICcnK3ZhbDsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgaWYodmFsID09PSBuZWVkbGUpIHsNCiAgICAgICAgICAgICAgICAgICAgaW5kZXggPSBpOw0KICAgICAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICB9DQogICAgICAgICAgICByZXR1cm4gaW5kZXg7DQogICAgICAgIH07DQogICAgcmV0dXJuIGluZGV4T2YuY2FsbCh0aGlzLCBuZWVkbGUsIHN0cik7DQp9Ow0KLy8gcmVzZXQgYSBodG1sIGxpc3QNCmZ1bmN0aW9uIHJlc2V0TGlzdChsaXN0X25hbWUsIGlkLCBzaGlueV9pbnB1dF9uYW1lKSB7DQogIHZhciBsaXN0ID0gZG9j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bkNsdXN0ZXIoc2VsZWN0ZWROb2RlKQ0KICAgICAgICAgIC8qaW5zdGFuY2UubmV0d29yay5vcGVuQ2x1c3RlcihzZWxlY3RlZE5vZGUsIA0KICAgICAgICAgIHtyZWxlYXNlRnVuY3Rpb24gOiBmdW5jdGlvbihjbHVzdGVyUG9zaXRpb24sIGNvbnRhaW5lZE5vZGVzUG9zaXRpb25zKSB7DQogICAgICAgICAgICByZXR1cm4gdG1wX3Bvc2l0aW9uOw0KICAgICAgICAgIH19KSovDQogICAgICAgICAgLy9uZXR3b3JrT3BlbkNsdXN0ZXIoc2VsZWN0ZWROb2RlKQ0KICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgIHZhciBmaXJzdExldmVsTm9kZXMgPSBbXTsNCiAgICAgICAgICB2YXIgb3RoZXJMZXZlbE5vZGVzID0gW107DQogICAgICAgICAgdmFyIGNvbm5lY3RlZFRvTm9kZXMgPSBbXTsNCiAgICAgIA0KICAgICAgICAgIGl0ZW0gPSBuZXR3b3JrLmJvZHkuZGF0YS5ub2Rlcy5nZXQoew0KICAgICAgICAgICAgZmlsdGVyOiBmdW5jdGlvbiAoaXRlbSkgew0KICAgICAgICAgICAgICByZXR1cm4gaXRlbS5pZCA9PSBzZWxlY3RlZE5vZGU7DQogICAgICAgICAgICB9DQogICAgICAgICAgfSk7DQogICAgICAgICAgICANCiAgICAgICAgICBjb25uZWN0ZWRUb05vZGVzID0gbmV0d29yay5ib2R5LmRhdGEuZWRnZXMuZ2V0KHsNCiAgICAgICAgICBmaWVsZHM6IFsnaWQnLCd0byddLA0KICAgICAgICAgICAgZmlsdGVyOiBmdW5jdGlvbiAoaXRlbSkgew0KICAgICAgICAgICAgICByZXR1cm4gaXRlbS5mcm9tID09IHNlbGVjdGVkTm9kZTsNCiAgICAgICAgICAgIH0sDQogICAgICAgICAgICByZXR1cm5UeXBlIDonQXJyYXknDQogICAgICAgICAgfSk7DQogICAgICAgICAgICAgIA0KICAgICAgICAgIGZvciAoaiA9IDA7IGogPCBjb25uZWN0ZWRUb05vZGVzLmxlbmd0aDsgaisrKSB7DQogICAgICAgICAgICBmaXJzdExldmVsTm9kZXMgPSBmaXJzdExldmVsTm9kZXMuY29uY2F0KGNvbm5lY3RlZFRvTm9kZXNbal0udG8pOw0KICAgICAgICAgIH0NCiAgICANCiAgICAgICAgICB2YXIgY3VycmVudENvbm5lY3RlZFRvTm9kZXMgPSBmaXJzdExldmVsTm9kZXM7DQogICAgICAgICAgd2hpbGUoY3VycmVudENvbm5lY3RlZFRvTm9kZXMubGVuZ3RoICE9PSAwKXsNCiAgICAgICAgICAgIGNvbm5lY3RlZFRvTm9kZXMgPSBuZXR3b3JrLmJvZHkuZGF0YS5lZGdlcy5nZXQoew0KICAgICAgICAgICAgICBmaWVsZHM6IFsnaWQnLCAndG8nXSwNCiAgICAgICAgICAgICAgICBmaWx0ZXI6IGZ1bmN0aW9uIChpdGVtKSB7DQogICAgICAgICAgICAgICAgICByZXR1cm4gaW5kZXhPZi5jYWxsKGN1cnJlbnRDb25uZWN0ZWRUb05vZGVzLCBpdGVtLmZyb20sIHRydWUpID4gLTE7DQogICAgICAgICAgICAgICAgfSwNCiAgICAgICAgICAgICAgICByZXR1cm5UeXBlIDonQXJyYXknDQogICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICANCiAgICAgICAgICAgIGN1cnJlbnRDb25uZWN0ZWRUb05vZGVzID0gW107DQogICAgICAgICAgICB2YXIgY3VycmVudGxlbmd0aCA9IG90aGVyTGV2ZWxOb2Rlcy5sZW5ndGg7DQogICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgY29ubmVjdGVkVG9Ob2Rlcy5sZW5ndGg7IGorKykgew0KICAgICAgICAgICAgICBvdGhlckxldmVsTm9kZXMgPSB1bmlxdWVBcnJheShvdGhlckxldmVsTm9kZXMuY29uY2F0KGNvbm5lY3RlZFRvTm9kZXNbal0udG8pLCBmYWxzZSwgbmV0d29yayk7DQogICAgICAgICAgICAgIGN1cnJlbnRDb25uZWN0ZWRUb05vZGVzID0gdW5pcXVlQXJyYXkoY3VycmVudENvbm5lY3RlZFRvTm9kZXMuY29uY2F0KGNvbm5lY3RlZFRvTm9kZXNbal0udG8pLCBmYWxzZSwgbmV0d29yayk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBpZiAob3RoZXJMZXZlbE5vZGVzLmxlbmd0aCA9PT0gY3VycmVudGxlbmd0aCkgeyBicmVhazsgfQ0KICAgICAgICAgIH0NCiAgICAgICAgICAgICAgDQogICAgICAgICAgdmFyIGZpbmFsRmlyc3RMZXZlbE5vZGVzID0gW107DQogICAgICAgICAgZm9yIChqID0gMDsgaiA8IGZpcnN0TGV2ZWxOb2Rlcy5sZW5ndGg7IGorKykgew0KICAgICAgICAgICAgdmFyIGZpbmRub2RlID0gbmV0d29yay5jbHVzdGVyaW5nLmZpbmROb2RlKGZpcnN0TGV2ZWxOb2Rlc1tqXSkNCiAgICAgICAgICAgIGlmKGZpbmRub2RlLmxlbmd0aCA9PT0gMSl7DQogICAgICAgICAgICAgIGZpbmFsRmlyc3RMZXZlbE5vZGVzID0gZmluYWxGaXJzdExldmVsTm9kZXMuY29uY2F0KGZpcnN0TGV2ZWxOb2Rlc1tqXSk7DQogICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICBmaW5hbEZpcnN0TGV2ZWxOb2RlcyA9IGZpbmFsRmlyc3RMZXZlbE5vZGVzLmNvbmNhdChmaW5kbm9kZVswXSk7DQogICAgICAgICAgICB9DQogICAgICAgICAgfQ0KICAgICAgICAgIA0KICAgICAgICAgIHZhciBmaW5hbENsdXN0ZXJOb2RlcyA9IFtdOw0KICAgICAgICAgIGZvciAoaiA9IDA7IGogPCBvdGhlckxldmVsTm9kZXMubGVuZ3RoOyBqKyspIHsNCiAgICAgICAgICAgIHZhciBmaW5kbm9kZSA9IG5ldHdvcmsuY2x1c3RlcmluZy5maW5kTm9kZShvdGhlckxldmVsTm9kZXNbal0pDQogICAgICAgICAgICBpZihmaW5kbm9kZS5sZW5ndGggPT09IDEpew0KICAgICAgICAgICAgICBmaW5hbENsdXN0ZXJOb2RlcyA9IGZpbmFsQ2x1c3Rlck5vZGVzLmNvbmNhdChvdGhlckxldmVsTm9kZXNbal0pOw0KICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgZmluYWxDbHVzdGVyTm9kZXMgPSBmaW5hbENsdXN0ZXJOb2Rlcy5jb25jYXQoZmluZG5vZGVbMF0pOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgIH0NCiAgICANCiAgICAgICAgICBpZihzZXRfcG9zaXRpb24peyANCiAgICAgICAgICAgIG5ldHdvcmsuc3RvcmVQb3NpdGlvbnMoKTsNCiAgICAgICAgICB9DQogICAgDQogICAgICAgICAgdmFyIGNsdXN0ZXJPcHRpb25zID0gew0KICAgICAgICAgICAgam9pbkNvbmRpdGlvbjogZnVuY3Rpb24gKG5vZGVzT3B0aW9ucykgew0KICAgICAgICAgICAgICByZXR1cm4gbm9kZXNPcHRpb25zLmlkID09PSBzZWxlY3RlZE5vZGUgfHwgaW5kZXhPZi5jYWxsKGZpbmFsRmlyc3RMZXZlbE5vZGVzLCBub2Rlc09wdGlvbnMuaWQsIHRydWUpID4gLTEgfHwgDQogICAgICAgICAgICAgICAgICBpbmRleE9mLmNhbGwoZmluYWxDbHVzdGVyTm9kZXMsIG5vZGVzT3B0aW9ucy5pZCwgdHJ1ZSkgPiAtMTsgDQogICAgICAgICAgICAgIH0sDQogICAgICAgICAgICAgIHByb2Nlc3NQcm9wZXJ0aWVzOiBmdW5jdGlvbihjbHVzdGVyT3B0aW9ucywgY2hpbGROb2Rlcykgew0KICAgICAgICAgICAgICAgIHZhciBjbGlja19ub2RlID0gbmV0d29yay5ib2R5LmRhdGEubm9kZXMuZ2V0KHsNCiAgICAgICAgICAgICAgICAgIGZpbHRlcjogZnVuY3Rpb24gKGl0ZW0pIHsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGl0ZW0uaWQgPT0gc2VsZWN0ZWROb2RlOw0KICAgICAgICAgICAgICAgICAgfSwNCiAgICAgICAgICAgICAgICAgIHJldHVyblR5cGUgOidBcnJheScNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICANCiAgICAgICAgICAgICAgICB2YXIgaXNfaGFyZF90b19yZWFkID0gZmFsc2U7DQogICAgICAgICAgICAgICAgaWYoY2xpY2tfbm9kZVswXS5pc0hhcmRUb1JlYWQgIT09IHVuZGVmaW5lZCl7DQogICAgICAgICAgICAgICAgICBpc19oYXJkX3RvX3JlYWQgPSBjbGlja19ub2RlWzBdLmlzSGFyZFRvUmVhZDsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgDQogICAgICAgICAgICAgICAgZm9yICh2YXIgaSBpbiBjbGlja19ub2RlWzBdKSB7DQogICAgICAgICAgICAgICAgICBpZihpICE9PSAiaWQiICYmIGkgIT09ICJpc0hhcmRUb1JlYWQiKXsNCiAgICAgICAgICAgICAgICAgICAgaWYoaSA9PT0gImxhYmVsIiAmJiBpc19oYXJkX3RvX3JlYWQpew0KICAgICAgICAgICAgICAgICAgICAgIGNsdXN0ZXJPcHRpb25zW2ldPSAgY2xpY2tfbm9kZVswXVsiaGlkZGVuTGFiZWwiXTsNCiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmKGkgPT09ICJjb2xvciIgJiYgaXNfaGFyZF90b19yZWFkKSB7DQogICAgICAgICAgICAgICAgICAgICAgY2x1c3Rlck9wdGlvbnNbaV09ICBjbGlja19ub2RlWzBdWyJoaWRkZW5Db2xvciJdOw0KICAgICAgICAgICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICAgICAgICAgICBjbHVzdGVyT3B0aW9uc1tpXT0gIGNsaWNrX25vZGVbMF1baV07DQogICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICANCiAgICAgICAgICAgICAgICAvLyBnZXN0aW9uIGRlcyB0cmVlDQogICAgICAgICAgICAgICAgaWYodHJlZVBhcmFtcyAhPT0gdW5kZWZpbmVkKXsNCiAgICAgICAgICAgICAgICAgIGlmKHRyZWVQYXJhbXMudXBkYXRlU2hhcGUpew0KICAgICAgICAgICAgICAgICAgICBjbHVzdGVyT3B0aW9ucy5sYWJlbCA9IGNsdXN0ZXJPcHRpb25zLmxhYmVsQ2x1c3QNCiAgICAgICAgICAgICAgICAgICAgY2x1c3Rlck9wdGlvbnMuY29sb3IgPSBjbHVzdGVyT3B0aW9ucy5jb2xvckNsdXN0DQogICAgICAgICAgICAgICAgICAgIGNsdXN0ZXJPcHRpb25zLnNoYXBlID0gdHJlZVBhcmFtcy5zaGFwZVkNCiAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICANCiAgICAgICAgICAgICAgICBpZihjbHVzdGVyT3B0aW9ucy5sYWJlbCAhPT0gdW5kZWZpbmVkKXsNCiAgICAgICAgICAgICAgICAgIGNsdXN0ZXJPcHRpb25zLmxhYmVsID0gY2x1c3Rlck9wdGlvbnMubGFiZWwgKyAiICIgKyBsYWJlbFN1ZmZpeDsNCiAgICAgICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICAgICAgY2x1c3Rlck9wdGlvbnMubGFiZWwgPSAgbGFiZWxTdWZmaXg7DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgDQogICAgICAgICAgICAgICAgaWYoY2x1c3Rlck9wdGlvbnMuYm9yZGVyV2lkdGggIT09IHVuZGVmaW5lZCl7DQogICAgICAgICAgICAgICAgICBjbHVzdGVyT3B0aW9ucy5ib3JkZXJXaWR0aCA9IGNsdXN0ZXJPcHRpb25zLmJvcmRlcldpZHRoICogMzsNCiAgICAgICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICAgICAgY2x1c3Rlck9wdGlvbnMuYm9yZGVyV2lkdGggPSAgMzsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICANCiAgICAgICAgICAgICAgICBpZihzZXRfcG9zaXRpb24pew0KICAgICAgICAgICAgICAgICAgaWYoY2xpY2tfbm9kZVswXS54ICE9PSB1bmRlZmluZWQpew0KICAgICAgICAgICAgICAgICAgICBjbHVzdGVyT3B0aW9ucy54ID0gY2xpY2tfbm9kZVswXS54Ow0KICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgaWYoY2xpY2tfbm9kZVswXS55ICE9PSB1bmRlZmluZWQpew0KICAgICAgICAgICAgICAgICAgICBjbHVzdGVyT3B0aW9ucy55ID0gY2xpY2tfbm9kZVswXS55Ow0KICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICANCiAgICAgICAgICAgICAgICBpZihjbHVzdGVyUGFyYW1zICE9PSB1bmRlZmluZWQpew0KICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaiBpbiBjbHVzdGVyUGFyYW1zKSB7DQogICAgICAgICAgICAgICAgICAgIGNsdXN0ZXJPcHRpb25zW2pdPSAgY2x1c3RlclBhcmFtc1tqXTsNCiAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgIA0KICAgICAgICAgICAgICByZXR1cm4gY2x1c3Rlck9wdGlvbnM7DQogICAgICAgICAgICB9LA0KICAgICAgICAgICAgY2x1c3Rlck5vZGVQcm9wZXJ0aWVzOiB7DQogICAgICAgICAgICAgIGFsbG93U2luZ2xlTm9kZUNsdXN0ZXI6IGZhbHNlDQogICAgICAgICAgICB9DQogICAgICAgICAgfQ0KICAgICAgICAgIG5ldHdvcmsuY2x1c3RlcihjbHVzdGVyT3B0aW9ucyk7DQogICAgICAgIH0NCiAgICAgIH0NCiAgICAgIA0KICAgIH0NCiAgICBpZihyZXNldEhpZ2hsaWdodC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lICE9PSB1bmRlZmluZWQpew0KICAgICAgICBpZihuZXR3b3JrLmlzQ2x1c3RlcihzZWxlY3RlZE5vZGUpKXsNCiAgICAgICAgICBpZihrZWVwQ29vcmQpew0KICAgICAgICAgICAgbmV0d29yay5vcGVuQ2x1c3RlcihzZWxlY3RlZE5vZGUsIA0KICAgICAgICAgICAgICB7cmVsZWFzZUZ1bmN0aW9uIDogZnVuY3Rpb24oY2x1c3RlclBvc2l0aW9uLCBjb250YWluZWROb2Rlc1Bvc2l0aW9ucykgew0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29udGFpbmVkTm9kZXNQb3NpdGlvbnM7DQogICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgIH0pOw0KICAgICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICBuZXR3b3JrLm9wZW5DbHVzdGVyKHNlbGVjdGVkTm9kZSkNCiAgICAgICAgICB9DQogICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgaWYoaW5kZXhPZi5jYWxsKG5vZGVzX2luX2NsdXN0ZXJzLCBzZWxlY3RlZE5vZGUsIHRydWUpID4gLTEpew0KICAgICAgICAgICAgLy8gbm90IGEgY2x1c3RlciBpbnRvIGEgY2x1c3Rlci4uLg0KICAgICAgICAgICAgaWYoc2VsZWN0ZWROb2RlLnNlYXJjaCgvXmNsdXN0ZXIvaSkgPT09IC0xKXsNCiAgICAgICAgICAgICAgY2x1c3Rlcl9ub2RlID0gbmV0d29yay5jbHVzdGVyaW5nLmZpbmROb2RlKHNlbGVjdGVkTm9kZSlbMF07DQogICAgICAgICAgICAgIGlmKG5ldHdvcmsuaXNDbHVzdGVyKGNsdXN0ZXJfbm9kZSkpew0KICAgICAgICAgICAgICAgIGlmKGtlZXBDb29yZCl7DQogICAgICAgICAgICAgICAgICBuZXR3b3JrLm9wZW5DbHVzdGVyKGNsdXN0ZXJfbm9kZSwgDQogICAgICAgICAgICAgICAgICAgIHtyZWxlYXNlRnVuY3Rpb24gOiBmdW5j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ICAgICAgaWYoZGF0YS50eXBlID09PSAib25jZSIpew0KICAgICAgICAgIGZvciAodmFyIGtleSBpbiBkYXRhLmV2ZW50cykgew0KICAgICAgICAgICAgZXZhbCgnbmV0d29yay5vbmNlKCInICsga2V5ICsgJyIsJyArIGRhdGEuZXZlbnRzW2tleV0gKyAnKScpOw0KICAgICAgICAgIH0NCiAgICAgICAgfSBlbHNlIGlmKGRhdGEudHlwZSA9PT0gIm9uIil7DQogICAgICAgICAgZm9yICh2YXIga2V5IGluIGRhdGEuZXZlbnRzKSB7DQogICAgICAgICAgICBldmFsKCduZXR3b3JrLm9uKCInICsga2V5ICsgJyIsJyArIGRhdGEuZXZlbnRzW2tleV0gKyAnKScpOw0KICAgICAgICAgIH0NCiAgICAgICAgfSBlbHNlIGlmKGRhdGEudHlwZSA9PT0gIm9mZiIpew0KICAgICAgICAgIGZvciAodmFyIGtleSBpbiBkYXRhLmV2ZW50cykgew0KICAgICAgICAgICAgZXZhbCgnbmV0d29yay5vZmYoIicgKyBrZXkgKyAnIiwnICsgZGF0YS5ldmVudHNba2V5XSArICcpJyk7DQogICAgICAgICAgfQ0KICAgICAgICB9DQogICAgICB9DQogIH0pOw0KICANCiAgLy8gbW92ZU5vZGUgbWV0aG9kDQogIFNoaW55LmFkZEN1c3RvbU1lc3NhZ2VIYW5kbGVyKCd2aXNTaGlueU1vdmVOb2RlJywgZnVuY3Rpb24oZGF0YSl7DQogICAgICAvLyBnZXQgY29udGFpbmVyIGlkDQogICAgICB2YXIgZWwgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgiZ3JhcGgiK2RhdGEuaWQpOw0KICAgICAgaWYoZWwpew0KICAgICAgICB2YXIgbmV0d29yayA9IGVsLmNoYXJ0Ow0KICAgICAgICBuZXR3b3JrLm1vdmVOb2RlKGRhdGEubm9kZUlkLCBkYXRhLngsIGRhdGEueSk7DQogICAgICB9DQogIH0pOw0KICANCiAgLy8gdW5zZWxlY3RBbGwgbWV0aG9kDQogIFNoa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ZCgiZ3JhcGgiK2RhdGEuaWQpOw0KICAgICAgDQogICAgICBpZihlbCl7DQogICAgICAgIHZhciBuZXR3b3JrID0gZWwuY2hhcnQ7DQogICAgICAgIHZhciBvcHRpb25zID0gZWwub3B0aW9uczsNCiAgICAgICAgLy8gY29uZmlndXJlDQogICAgICAgIGlmKGRhdGEub3B0aW9ucy5jb25maWd1cmUgIT09IHVuZGVmaW5lZCl7DQogICAgICAgICAgaWYoZGF0YS5vcHRpb25zLmNvbmZpZ3VyZS5jb250YWluZXIgIT09IHVuZGVmaW5lZCl7DQogICAgICAgICAgICB2YXIgZG9tX2NvbmYgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZChkYXRhLm9wdGlvbnMuY29uZmlndXJlLmNvbnRhaW5lcik7DQogICAgICAgICAgICBpZihkb21fY29uZiAhPT0gbnVsbCl7DQogICAgICAgICAgICAgIGRhdGEub3B0aW9ucy5jb25maWd1cmUuY29udGFpbmVyID0gZG9tX2NvbmY7DQogICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICBkYXRhLm9wdGlvbnMuY29uZmlndXJlLmNvbnRhaW5lciA9IHVuZGVmaW5lZDsNCiAgICAgICAgICAgIH0NCiAgICAgICAgICB9DQogICAgICAgIH0NCiAgICANCiAgICAgICAgLy8qKioqKioqKioqKioqKioqKioqKioqKioqDQogICAgICAgIC8vIHByZS10cmVhdG1lbnQgZm9yIGljb25zICh1bmljb2RlKQ0KICAgICAgICAvLyoqKioqKioqKioqKioqKioqKioqKioqKioNCiAgICAgICAgaWYoZGF0YS5vcHRpb25zLmdyb3Vwcyl7DQogICAgICAgICAgZm9yICh2YXIgZ3IgaW4gZGF0YS5vcHRpb25zLmdyb3Vwcyl7DQogICAgICAgICAgICBpZihkYXRhLm9wdGlvbnMuZ3JvdXBzW2dyXS5pY29uKXsNCiAgICAgICAgICAgICAgaWYoZGF0YS5vcHRpb25zLmdyb3Vwc1tncl0uaWNvbi5jb2RlKXsNCiAgICAgICAgICAgICAgICBkYXRhLm9wdGlvbnMuZ3JvdXBzW2dyXS5pY29uLmNvZGUgPSBKU09OLnBhcnNlKCAnIicrJ1xcdScgKyBkYXRhLm9wdGlvbnMuZ3JvdXBzW2dyXS5pY29uLmNvZGUgKyAnIicpOw0KICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgIGlmKGRhdGEub3B0aW9ucy5ncm91cHNbZ3JdLmljb24uY29sb3Ipew0KICAgICAgICAgICAgICAgIGRhdGEub3B0aW9ucy5ncm91cHNbZ3JdLmNvbG9yID0gZGF0YS5vcHRpb25zLmdyb3Vwc1tncl0uaWNvbi5jb2xvcjsNCiAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgfQ0KICAgICAgICAgIH0NCiAgICAgICAgfQ0KICAgICAgICANCiAgICAgICAgaWYoZGF0YS5vcHRpb25zLm5vZGVzKXsNCiAgICAgICAgICBpZihkYXRhLm9wdGlvbnMubm9kZXMuaWNvbil7DQogICAgICAgICAgICBpZihkYXRhLm9wdGlvbnMubm9kZXMuaWNvbi5jb2RlKXsNCiAgICAgICAgICAgICAgZGF0YS5vcHRpb25zLm5vZGVzLmljb24uY29kZSA9IEpTT04ucGFyc2UoICciJysnXFx1JyArIGRhdGEub3B0aW9ucy5ub2Rlcy5pY29uLmNvZGUgKyAnIicpOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgaWYoZGF0YS5vcHRpb25zLm5vZGVzLmljb24uY29sb3Ipew0KICAgICAgICAgICAgICBkYXRhLm9wdGlvbnMubm9kZXMuY29sb3IgPSBkYXRhLm9wdGlvbnMubm9kZXMuaWNvbi5jb2xvcjsNCiAgICAgICAgICAgIH0NCiAgICAgICAgICB9DQogICAgICAgIH0NCg0KICAgICAgICANCiAgICAgICAgdXBkYXRlKG9wdGlvbnMsIGRhdGEub3B0aW9ucyk7DQogICAgICAgIG5ldHdvcmsuc2V0T3B0aW9ucyhvcHRpb25zKTsNCiAgICAgIH0NCiAgfSk7DQogIA0KICAvLyBzZXREYX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WN0aW9uLnZhcmlhYmxlOw0KICAgICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICAgIG9wdGlvbjIudGV4dCA9IGRhdGEub3B0aW9ucy5ieXNlbGVjdGlvbi5tYWluOw0KICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgIA0KICAgICAgICAgICAgICBzZWxlY3RMaXN0Mi5hcHBlbmRDaGlsZChvcHRpb24yKTsNCiAgICAgIA0KICAgICAgICAgICAgICBpZihkYXRhLm9wdGlvbnMuYnlzZWxlY3Rpb24udmFsdWVzICE9PSB1bmRlZmluZWQpew0KICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZGF0YS5vcHRpb25zLmJ5c2VsZWN0aW9uLnZhbHVlcy5sZW5ndGg7IGkrKykgew0KICAgICAgICAgICAgICAgICAgb3B0aW9uMiA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoIm9wdGlvbiIpOw0KICAgICAgICAgICAgICAgICAgb3B0aW9uMi52YWx1ZSA9IGRhdGEub3B0aW9ucy5ieXNlbGVjdGlvbi52YWx1ZXNbaV07DQogICAgICAgICAgICAgICAgICBvcHRpb24yLnRleHQgPSBkYXRhLm9wdGlvbnMuYnlzZWxlY3Rpb24udmFsdWVzW2ldOw0KICAgICAgICAgICAgICAgICAgc2VsZWN0TGlzdDIuYXBwZW5kQ2hpbGQob3B0aW9uMik7DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICB9ZWxzZXsNCiAgICAgICAgICAgICAgICBkb19sb29wX2J5ID0gdHJ1ZTsNCiAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgIGVsLmJ5c2VsZWN0aW9uX3ZhcmlhYmxlID0gZGF0YS5vcHRpb25zLmJ5c2VsZWN0aW9uLnZhcmlhYmxlOw0KICAgICAgICAgICAgICBlbC5ieXNlbGVjdGlvbl9tdWx0aXBsZSA9IGRhdGEub3B0aW9ucy5ieXNlbGVjdGlvbi5tdWx0aXBsZTsN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lY3RlZEJ5IitkYXRhLmlkKS5vbmNoYW5nZSgpOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgIH0NCiAgICAgICAgICANCiAgICAgICAgICBpZihkb19sb29wX2J5KXsNCiAgICAgICAgICAgICAgdmFyIGFsbE5vZGVzID0gZ3JhcGgubm9kZXMuZ2V0KHtyZXR1cm5UeXBlOiJPYmplY3QifSk7DQogICAgICAgICAgICAgIHZhciBieXNlbGVjdGlvbl92YWx1ZXMgPSBbXTsNCiAgICAgICAgICAgICAgZm9yICh2YXIgbm9kZUlkIGluIGFsbE5vZGVzKSB7DQogICAgICAgICAgICAgICAgaWYoZG9fbG9vcF9ieSl7DQogICAgICAgICAgICAgICAgICB2YXIgY3VycmVudF9zZWxfdmFsdWUgPSBhbGxOb2Rlc1tub2RlSWRdW2RhdGEub3B0aW9ucy5ieXNlbGVjdGlvbi52YXJpYWJsZV07DQogICAgICAgICAgICAgICAgICBpZihkYXRhLm9wdGlvbnMuYnlzZWxlY3Rpb24ubXVsdGlwbGUpew0KICAgICAgICAgICAgICAgICAgICBjdXJyZW50X3NlbF92YWx1ZSA9IGN1cnJlbnRfc2VsX3ZhbHVlLnNwbGl0KCIsIikubWFwKEZ1bmN0aW9uLnByb3RvdHlwZS5jYWxsLCBTdHJpbmcucHJvdG90eXBlLnRyaW0pOw0KICAgICAgICAgICAgICAgICAgfWVsc2V7DQogICAgICAgICAgICAgICAgICAgIGN1cnJlbnRfc2VsX3ZhbHVlID0gW2N1cnJlbnRfc2VsX3ZhbHVlXTsNCiAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgIGZvcih2YXIgaW5kX2MgaW4gY3VycmVudF9zZWxfdmFsdWUpew0KICAgICAgICAgICAgICAgICAgICBpZihpbmRleE9mLmNhbGwoYnlzZWxlY3Rpb25fdmFsdWVzLCBjdXJyZW50X3NlbF92YWx1ZVtpbmRfY10sIGZhbHNlKSA9PT0gLTEpew0KICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbjIgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCJvcHRpb24iKTsNCiAgICAgICAgICAgICAgICAgICAgICBvcHRpb24yLnZhbHVlID0gY3VycmVudF9zZWxfdmFsdWVbaW5kX2NdOw0KICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbjIudGV4dCA9IGN1cnJlbnRfc2VsX3ZhbHVlW2luZF9jXTsNCiAgICAgICAgICAgICAgICAgICAgICBzZWxlY3RMaXN0Mi5hcHBlbmRDaGlsZChvcHRpb24yKTsNCiAgICAgICAgICAgICAgICAgICAgICBieXNlbGVjdGlvbl92YWx1ZXMucHVzaChjdXJyZW50X3NlbF92YWx1ZVtpbmRfY10pOw0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICB9IA0KICAgICAgICAgIH0NCiAgICAgICAgICANCiAgICAgICAgICAvLyBub2RlIGlkIHNlbGVjdGlvbiBpbml0DQogICAgICAgICAgaWYoZGF0YS5vcHRpb25zLmlkc2VsZWN0aW9uICE9PSB1bmRlZmluZWQpew0KICAgICAgICAgICAgc2VsZWN0TGlzdCA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJub2RlU2VsZWN0IitkYXRhLmlkKQ0KICAgICAgICAgICAgc2VsZWN0TGlzdC5vcHRpb25zLmxlbmd0aCA9IDA7DQogICAgICAgICAgICBpZihkYXRhLm9wdGlvbnMuaWRzZWxlY3Rpb24uZW5hYmxlZCA9PT0gdHJ1ZSl7DQogICAgICAgICAgICAgIHNldE5vZGVJZExpc3Qoc2VsZWN0TGlzdCwgZGF0YS5vcHRpb25zLmlkc2VsZWN0aW9uLCBncmFwaC5ub2RlcykNCiAgICAgICAgICAgICAgZWwuaWRzZWxlY3Rpb24gPSB0cnVlOw0KICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgc2VsZWN0TGlzdC5zdHlsZS5kaXNwbGF5ID0gJ25v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KICAgICAgICAgICAgaWYgKG1haW5fZWwuaGlnaGxpZ2h0QWN0aXZlID09PSB0cnVlKXsNCiAgICAgICAgICAgICAgbWFpbl9lbC5oaWdobGlnaHRBY3RpdmUgPSBmYWxzZTsNCiAgICAgICAgICAgICAgcmVzZXRMaXN0KCdub2RlU2VsZWN0JywgZGF0YS5pZCwgJ3NlbGVjdGVkJyk7DQogICAgICAgICAgICB9DQogICAgICAgICAgfQ0KICAgICAgICAgIC8vIHVwZGF0ZSBub2Rlcw0KICAgICAgICAgIGVsLm5vZGVzLnVwZGF0ZSh0bXBub2Rlcyk7DQogICAgICAgICAgDQogICAgICAgICAgLy8gdXBkYXRlIG9wdGlvbnMgPw0KICAgICAgICAgIGlmKGRhdGEudXBkYXRlT3B0aW9ucyl7DQogICAgICAgICAgICB2YXIgZGF0YU9wdGlvbnMgPSB7fTsNCiAgICAgICAgICAgIGRhdGFPcHRpb25zLm9wdGlvbnMgPSB7fTsNCiAgICAgICAgICANCiAgICAgICAgICAgIHZhciB1cGRhdGVPcHRzID0gZmFsc2U7DQogICAgICAgICAgICBpZihkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgibm9kZVNlbGVjdCIrZGF0YS5pZCkuc3R5bGUuZGlzcGxheSA9PT0gJ2lubGluZScpew0KICAgICAgICAgICAgICB1cGRhdGVPcHRzID0gdHJ1ZTsNCiAgICAgICAgICAgICAgZGF0YU9wdGlvbnMuaWQgID0gZGF0YS5pZDsNCiAgICAgICAgICAgICAgZGF0YU9wdGlvbnMub3B0aW9ucy5pZHNlbGVjdGlvbiA9IHtlbmFibGVkIDogdHJ1ZSwgdXNlTGFiZWxzIDogbWFpbl9lbC5pZHNlbGVjdGlvbl91c2VMYWJlbHN9Ow0KICAgICAgICAgICAgfQ0KICAgICAgDQogICAgICAgICAgICBpZihkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgic2VsZWN0ZWRCeSIrZGF0YS5pZCkuc3R5bGUuZGlzcGxheSA9PT0gJ2lubGluZScpew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Gl0bGUuc3R5bGUuZGlzcGxheSA9ICdub25lJzsNCiAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICBpZihkYXRhLm1haW4udGV4dCAhPT0gdW5kZWZpbmVkKXsNCiAgICAgICAgICAgIGlmKGRhdGEubWFpbi50ZXh0ICE9PSBudWxsKXsNCiAgICAgICAgICAgICAgaWYoZGF0YS5tYWluLnRleHQubGVuZ3RoID4gMCl7DQogICAgICAgICAgICAgICAgZGl2X3RpdGxlLmlubmVySFRNTCA9IGRhdGEubWFpbi50ZXh0Ow0KICAgICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICAgIGRpdl90aXRsZS5pbm5lckhUTUwgPSAiIjsNCiAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgfQ0KICAgICAgICAgIH0NCiAgICAgICAgICBpZihkYXRhLm1haW4uc3R5bGUgIT09IHVuZGVmaW5lZCl7DQogICAgICAgICAgICBpZihkYXRhLm1haW4uc3R5bGUgIT09IG51bGwpew0KICAgICAgICAgICAgICBpZihkYXRhLm1haW4uc3R5bGUubGVuZ3RoID4gMCl7DQogICAgICAgICAgICAgICAgZGl2X3RpdGxlLnNldEF0dHJpYnV0ZSgnc3R5bGUnLCAgZGF0YS5tYWluLnN0eWxlKTsNCiAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgfQ0KICAgICAgICAgIH0NCiAgICAgICAgICBkaXZfdGl0bGUuc3R5bGUuZGlzcGxheSA9ICdibG9jayc7DQogICAgICAgIH0gDQogICAgICB9DQogICAgfQ0KICAgIGlmKGRhdGEuc3VibWFpbiAhPT0gbnVsbCl7DQogICAgICB2YXIgZGl2X3N1YnRpdGxlID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoInN1YnRpdGxlIiArIGRhdGEuaWQpOw0KICAgICAgaWYoZGl2X3N1YnRpdGxlICE9PSBudWxsKXsNCiAgICAgICAgaWYoZGF0YS5zdWJtYWluLmhpZGRlbiA9PT0gdHJ1ZSl7DQogICAgICAgICAgZGl2X3N1YnRpdGxlLnN0eWxlLmRpc3BsYXkgPSAnbm9uZSc7DQogICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgaWYoZGF0YS5zdWJtYWluLnRleHQgIT09IHVuZGVmaW5lZCl7DQogICAgICAgICAgICBpZihkYXRhLnN1Ym1haW4udGV4dCAhPT0gbnVsbCl7DQogICAgICAgICAgICAgIGlmKGRhdGEuc3VibWFpbi50ZXh0Lmxlbmd0aCA+IDApew0KICAgICAgICAgICAgICAgIGRpdl9zdWJ0aXRsZS5pbm5lckhUTUwgPSBkYXRhLnN1Ym1haW4udGV4dDsNCiAgICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgICBkaXZfc3VidGl0bGUuaW5uZXJIVE1MID0gIiI7DQogICAgICAgICAgICAgIH0NCiAgICAgICAgICAgIH0NCiAgICAgICAgICB9DQogICAgICAgICAgaWYoZGF0YS5zdWJtYWluLnN0eWxlICE9PSB1bmRlZmluZWQpew0KICAgICAgICAgICAgaWYoZGF0YS5zdWJtYWluLnN0eWxlICE9PSBudWxsKXsNCiAgICAgICAgICAgICAgaWYoZGF0YS5zdWJtYWluLnN0eWxlLmxlbmd0aCA+IDApew0KICAgICAgICAgICAgICAgIGRpdl9zdWJ0aXRsZS5zZXRBdHRyaWJ1dGUoJ3N0eWxlJywgIGRhdGEuc3VibWFpbi5zdHlsZSk7DQogICAgICAgICAgICAgIH0NCiAgICAgICAgICAgIH0NCiAgICAgICAgICB9DQogICAgICAgICAgZGl2X3N1YnRpdGxlLnN0eWxlLmRpc3BsYXkgPSAnYmxvY2snOw0KICAgICAgICB9DQogICAgICB9DQogICAgfQ0KICAgIGlmKGRhdGEuZm9vdGVyICE9PSBudWxsKXsNCiAgICAgIHZhciBkaXZfZm9vdGVyID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoImZvb3RlciIgKyBkYXRhLmlkKTsNCiAgICAgIGlmKGRpdl9mb290ZXIgIT09IG51bGwpew0KICAgICAgICBpZihkYXRhLmZvb3Rlci5oaWRkZW4gPT09IHRydWUpew0KICAgICAgICAgIGRpdl9mb290ZXIuc3R5bGUuZGlzcGxheSA9ICdub25lJzsNCiAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICBpZihkYXRhLmZvb3Rlci50ZXh0ICE9PSB1bmRlZmluZWQpew0KICAgICAgICAgICAgaWYoZGF0YS5mb290ZXIudGV4dCAhPT0gbnVsbCl7DQogICAgICAgICAgICAgIGlmKGRhdGEuZm9vdGVyLnRleHQubGVuZ3RoID4gMCl7DQogICAgICAgICAgICAgICAgZGl2X2Zvb3Rlci5pbm5lckhUTUwgPSBkYXRhLmZvb3Rlci50ZXh0Ow0KICAgICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICAgIGRpdl9mb290ZXIuaW5uZXJIVE1MID0gIiI7DQogICAgICAgICAgICAgIH0NCiAgICAgICAgICAgIH0NCiAgICAgICAgICB9DQogICAgICAgICAgaWYoZGF0YS5mb290ZXIuc3R5bGUgIT09IHVuZGVmaW5lZCl7DQogICAgICAgICAgICBpZihkYXRhLmZvb3Rlci5zdHlsZSAhPT0gbnVsbCl7DQogICAgICAgICAgICAgIGlmKGRhdGEuZm9vdGVyLnN0eWxlLmxlbmd0aCA+IDApew0KICAgICAgICAgICAgICAgIGRpdl9mb290ZXIuc2V0QXR0cmlidXRlKCdzdHlsZScsICBkYXRhLmZvb3Rlci5zdHlsZSk7DQogICAgICAgICAgICAgIH0NCiAgICAgICAgICAgIH0NCiAgICAgICAgICB9DQogICAgICAgICAgZGl2X2Zvb3Rlci5zdHlsZS5kaXNwbGF5ID0gJ2Jsb2NrJzsNCiAgICAgICAgfSANCiAgICAgIH0NCiAgICB9DQogIH0pOw0KDQogIC8vIHVwZGF0ZVRyZWUNCiAgU2hpbnkuYWRkQ3VzdG9tTWVzc2FnZUhhbmRsZXIoJ3Zpc1NoaW55VXBkYXRlVHJlZScsIGZ1bmN0aW9uKGRhdGEpew0KICAgICAgL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zsNCiAgICB9DQogDQogICAgLy8qKioqKioqKioqKioqKioqKioqKioqKioqDQogICAgLy9pbml0IGlkc2VsZWN0aW9uDQogICAgLy8qKioqKioqKioqKioqKioqKioqKioqKioqDQogICAgZnVuY3Rpb24gb25JZENoYW5nZShpZCwgaW5pdCkgew0KICAgICAgaWYoaWQgPT09ICIiKXsNCiAgICAgICAgaW5zdGFuY2UubmV0d29yay5zZWxlY3ROb2RlcyhbXSk7DQogICAgICB9ZWxzZXsNCiAgICAgICAgaW5zdGFuY2UubmV0d29yay5zZWxlY3ROb2RlcyhbaWRdKTsNCiAgICAgIH0NCiAgICAgIGlmKGVsX2lkLmhpZ2hsaWdodCl7DQogICAgICAgIG5laWdoYm91cmhvb2RIaWdobGlnaHQoaW5zdGFuY2UubmV0d29yay5nZXRTZWxlY3Rpb24oKS5ub2RlcywgImNsaWNrIiwgZWxfaWQuaGlnaGxpZ2h0QWxnb3JpdGhtKTsNCiAgICAgIH1lbHNlew0KICAgICAgICBpZihpbml0KXsNCiAgICAgICAgICBzZWxlY3ROb2RlID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ25vZGVTZWxlY3QnK2VsLmlkKTsNCiAgICAgICAgICBpZih4Lmlkc2VsZWN0aW9uLnZhbHVlcyAhPT0gdW5kZWZpbmVkKXsNCiAgICAgICAgICAgIGlmKGluZGV4T2YuY2FsbCh4Lmlkc2VsZWN0aW9uLnZhbHVlcywgaWQsIHRydWUpID4gLTEpew0KICAgICAgICAgICAgICBzZWxlY3ROb2RlLnZhbHVlID0gaWQ7DQogICAgICAgICAgICB9ZWxzZXsNCiAgICAgICAgICAgICAgc2VsZWN0Tm9kZS52YWx1ZSA9ICIiOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgIH1lbHNlew0KICAgICAgICAgICAgc2VsZWN0Tm9kZS52YWx1ZSA9IGlkOw0KICAgICAgICAgIH0NCiAgICAgICAgfQ0KICAgICAgfQ0KICAgICAgaWYgKHdpbmRvdy5TaGlue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y5ncm91cHNbZ3JdLmljb24uY29kZSArICciJyk7DQogICAgICAgICAgfQ0KICAgICAgICAgIGlmKHgub3B0aW9ucy5ncm91cHNbZ3JdLmljb24uY29sb3Ipew0KICAgICAgICAgICAgeC5vcHRpb25zLmdyb3Vwc1tncl0uY29sb3IgPSB4Lm9wdGlvbnMuZ3JvdXBzW2dyXS5pY29uLmNvbG9yOw0KICAgICAgICAgIH0NCiAgICAgICAgfQ0KICAgICAgfQ0KICAgIH0NCiAgICANCiAgICBpZih4Lm9wdGlvbnMubm9kZXMuaWNvbil7DQogICAgICAgIGlmKHgub3B0aW9ucy5ub2Rlcy5pY29uLmNvZGUpew0KICAgICAgICAgIHgub3B0aW9ucy5ub2Rlcy5pY29uLmNvZGUgPSBKU09OLnBhcnNlKCAnIicrJ1xcdScgKyB4Lm9wdGlvbnMubm9kZXMuaWNvbi5jb2RlICsgJyInKTsNCiAgICAgICAgfQ0KICAgICAgICBpZih4Lm9wdGlvbnMubm9kZXMuaWNvbi5jb2xvcil7DQogICAgICAgICAgeC5vcHRpb25zLm5vZGVzLmNvbG9yID0geC5vcHRpb25zLm5vZGVzLmljb24uY29sb3I7DQogICAgICAgIH0NCiAgICB9DQogICAgDQogICAgLy8qKioqKioqKioqKioqKioqKioqKioqKioqDQogICAgLy9wYWdlIHN0cnVjdHVyZQ0KICAgIC8vKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIA0KICAgIC8vIGRpdmlkZSBwYWdlDQogICAgdmFyIG1haW5kaXYgID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnZGl2Jyk7DQogICAgbWFpbmRpdi5pZCA9ICJtYWluZGl2IitlbC5pZDsNCiAgICBtYWluZGl2LnNldEF0dHJpYnV0ZSgnc3R5bGUnLCAnaGVpZ2h0Ojk1JTtiYWNrZ3JvdW5kLWNvbG9yOiBpbmhlcml0OycpOw0KICAgIGVsX2lkLmFwcGVuZENoaWxkKG1haW5kaXYpOw0KICAgIA0KICAgIHZhciBncmF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BoKTsNCiAgICANCiAgICAvLyoqKioqKioqKioqKioqKioqKioqKioqKioNCiAgICAvL2xlZ2VuZCBkZWZpbml0aW9uDQogICAgLy8qKioqKioqKioqKioqKioqKioqKioqKioqDQogICAgaWYoYWRkbGVnZW5kKXsNCiAgICAgIA0KICAgICAgdmFyIGxlZ2VuZG5vZGVzID0gbmV3IHZpcy5EYXRhU2V0KCk7DQogICAgICB2YXIgbGVnZW5kZWRnZXMgPSBudWxsOw0KICAgICAgdmFyIGRhdGFsZWdlbmQ7DQogICAgICB2YXIgdG1wbm9kZXM7DQogICAgICANCiAgICAgIC8vIHNldCBzb21lIG9wdGlvbnMNCiAgICAgIHZhciBvcHRpb25zbGVnZW5kID0gew0KICAgICAgICBpbnRlcmFjdGlvbjp7DQogICAgICAgICAgZHJhZ05vZGVzOiBmYWxzZSwNCiAgICAgICAgICBkcmFnVmlldzogZmFsc2UsDQogICAgICAgICAgc2VsZWN0YWJsZTogZmFsc2UsDQogICAgICAgICAgem9vbVZpZXc6IHgubGVnZW5kLnpvb20NCiAgICAgICAgfSwNCiAgICAgICAgcGh5c2ljczp7DQogICAgICAgICAgc3RhYmlsaXphdGlvbjogZmFsc2UNCiAgICAgICAgfQ0KICAgICAgfTsNCiAgICAgIA0KICAgICAgZnVuY3Rpb24gcmFuZ2Uoc3RhcnQsIGxlbmd0aCwgc3RlcCwgcmVwKXsNCiAgICAgICAgdmFyIGE9W10sIGI9c3RhcnQ7DQogICAgICAgIHdoaWxlKGEubGVuZ3RoIDwgbGVuZ3RoKXsNCiAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHJlcDsgaSsrKXsNCiAgICAgICAgICAgIGEucHVzaChiKTsNCiAgICAgICAgICAgIGlmKGEubGVuZ3RoID09PSBsZW5ndGgpew0KICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgIH0NCiAgICAgICAgICB9DQogICAgICAgICAgYis9c3RlcDsNCiAgICAgICAgfQ0KICAgICAgICByZXR1cm4gYTs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Rlc1RvRGF0YWZyYW1lKXsNCiAgICAgICAgICAgIHRtcG5vZGVzW25kXS5pY29uLmNvZGUgPSBKU09OLnBhcnNlKCAnIicrJ1xcdScgKyB0bXBub2Rlc1tuZF0uaWNvbi5jb2RlICsgJyInKTsNCiAgICAgICAgICB9DQogICAgICAgIH0NCiAgICAgICAgLy8gZ3JvdXAgY29udHJvbCBmb3IgeQ0KICAgICAgICB2YXIgYWRkX2dyX3kgPSAwOw0KICAgICAgICBpZih4Lmdyb3VwcyAmJiB4LmxlZ2VuZC51c2VHcm91cHMpew0KICAgICAgICAgIGFkZF9ncl95ID0geC5ncm91cHMubGVuZ3RoOw0KICAgICAgICB9DQogICAgICAgIC8vIHNldCBjb29yZGluYXRlcw0KICAgICAgICBmb3IgKHZhciBnID0gMDsgZyA8IHRtcG5vZGVzLmxlbmd0aDsgZysrKXsNCiAgICAgICAgICBpZigoZytsZWdlbmRub2Rlcy5sZW5ndGgpID09PSAwKXsNCiAgICAgICAgICAgIHRtcF9seCA9IGx4Ow0KICAgICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICB0bXBfbHggPSBseCArIChnK2xlZ2VuZG5vZGVzLmxlbmd0aCklbmNvbCAqIHN0ZXBfeDsNCiAgICAgICAgICB9DQogICAgICAgICAgDQogICAgICAgICAgdG1wX2x5ID0gYWxsX3RtcF95W2FkZF9ncl95ICsgZ107DQogICAgICAgICAgaWYodG1wX2x4ID09PSAwKXsNCiAgICAgICAgICAgIHRtcF9seCA9IDENCiAgICAgICAgICB9DQogICAgICAgICAgaWYodG1wX2x5ID09PSAwKXsNCiAgICAgICAgICAgIHRtcF9seSA9IDENCiAgICAgICAgICB9DQogICAgICAgICAgdG1wbm9kZXNbZ10ueCA9IHRtcF9seDsNCiAgICAgICAgICB0bXBub2Rlc1tnXS55ID0gdG1wX2x5Ow0KICAgICAgICAgIA0KICAgICAgICAgIGlmKHRtcG5vZGVzW2ddLnZhbHVlID09PSB1bmRlZmluZWQgJiYgdG1wbm9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spew0KICAgICAgICAgIA0KICAgICAgICAgIHZhciB0bXBfaW50ID0gTWF0aC5mbG9vcihNYXRoLnJhbmRvbSgpICogMTAwMSk7DQogICAgICAgICAgbGVnZW5kZWRnZXNbZWRnXS5mcm9tID0gZWRnICsgInRtcF9sZWdfZWRnZXNfIiArIHRtcF9pbnQgKyAiXzEiOw0KICAgICAgICAgIGxlZ2VuZGVkZ2VzW2VkZ10udG8gPSBlZGcgKyAidG1wX2xlZ19lZGdlc18iICsgdG1wX2ludCArICJfMiI7DQogICAgICAgICAgbGVnZW5kZWRnZXNbZWRnXS5waHlzaWNzID0gZmFsc2U7DQogICAgICAgICAgbGVnZW5kZWRnZXNbZWRnXS5zbW9vdGggPSBmYWxzZTsNCiAgICAgICAgICBsZWdlbmRlZGdlc1tlZGddLnZhbHVlID0gdW5kZWZpbmVkOw0KDQogICAgICAgICAgaWYobGVnZW5kZWRnZXNbZWRnXS5hcnJvd3MgPT09IHVuZGVmaW5lZCl7DQogICAgICAgICAgICBsZWdlbmRlZGdlc1tlZGddLmFycm93cyA9ICd0byc7DQogICAgICAgICAgfQ0KICAgICAgICAgIA0KICAgICAgICAgIGlmKGxlZ2VuZGVkZ2VzW2VkZ10ud2lkdGggPT09IHVuZGVmaW5lZCl7DQogICAgICAgICAgICBsZWdlbmRlZGdlc1tlZGddLndpZHRoID0gMTsNCiAgICAgICAgICB9DQoNCiAgICAgICAgICB0bXBfbHkgPSBlZGdlX2x5ICsgKGVkZysxKSpzdGVwX3k7DQogICAgICAgICAgaWYodG1wX2x5ID09PSAwKXsNCiAgICAgICAgICAgIHRtcF9seSA9IDENCiAgICAgICAgICB9DQogICAgICAgICAgDQogICAgICAgICAgaWYobmNvbCA9PT0gMSl7DQogICAgICAgICAgICB0bXBfbHggPSBseCAtIG15bmV0d29yay5jbGllbnRXaWR0aC8zOw0KICAgICAgICAgICAgdG1wX2x4MiA9IGx4ICsgbXluZXR3b3JrLmNsaWVudFdpZHRoLzM7DQogICAgICAgICAgfS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b25zbGVnZW5kKTsNCiAgICAgIC8vbGluayBuZXR3b3JrIGZvciB1cGRhdGUgZm9yIHJlLXVzZSBhbmQgdXBkYXRlDQogICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgibGVnZW5kIitlbC5pZCkubmV0d29yayA9IGluc3RhbmNlLmxlZ2VuZDsNCiAgICB9DQogICAgDQogICAgLy8qKioqKioqKioqKioqKioqKioqKioqKioqDQogICAgLy8gTWFpbiBOZXR3b3JrIHJlbmRlcmluZw0KICAgIC8vKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIGlmKHgubm9kZXMpew0KICAgICAgDQogICAgICAvLyBuZXR3b3JrDQogICAgICBub2RlcyA9IG5ldyB2aXMuRGF0YVNldCgpOw0KICAgICAgZWRnZXMgPSBuZXcgdmlzLkRhdGFTZXQoKTsNCiAgICAgIA0KICAgICAgdmFyIHRtcG5vZGVzOw0KICAgICAgaWYoeC5ub2Rlc1RvRGF0YWZyYW1lKXsgLy8gZGF0YSBpbiBkYXRhLmZyYW1lDQogICAgICAgIHRtcG5vZGVzID0gdmlzTmV0d29ya2RhdGFmcmFtZVRvRDMoeC5ub2RlcywgIm5vZGVzIikNCiAgICAgIH0gZWxzZSB7IC8vIGRhdGEgaW4gbGlzdA0KICAgICAgICB0bXBub2RlcyA9IHgubm9kZXM7DQogICAgICB9DQogICAgICAvLyBvbmx5IG9uZSBlbGVtZW50ICAgDQogICAgICBpZih0bXBub2Rlcy5sZW5ndGggPT09IHVuZGVmaW5lZCl7DQogICAgICAgIHRtcG5vZGVzID0gbmV3IEFycmF5KHRtcG5vZGVzKTsNCiAgICAgIH0NCiAgICAgICAgDQogICAgICAvLyB1cGRhdGUgY29vcmRpbmF0ZXMgaWYgaWdyYXBoDQogICAgICBpZih4LmlncmFwaGxheW91dCAhPT0gdW5kZWZpbmVkKXsNCiAgICAgICAgLy8gdG8gaW1wcm92ZWQNCiAgICAgICAgdmFyIHpvb21MZXZlbCA9IC0yMzIuNjIyMzQ5IC8gKHRtcG5vZGVzLmxlbmd0aCArIDkxLjE2NTkxOSkgICsyLjUxNjg2MTsNCiAgICAgICAgdmFyIGlnY2xpZW50V2lkdGggPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgiZ3JhcGgiK2VsLmlkKS5jbGllbnRXaWR0aDsNCiAgICAgICAgdmFyIHNjYWxleCA9IDEwMDsNCiAgICAgICAgdmFyIHNjYWxleSA9IDEwMDsNCiAgICAgICAgDQogICAgICAgIC8vIGN1cnJlbnQgZGl2IHZpc2libGVkDQogICAgICAgIGlmKGlnY2xpZW50V2lkdGggIT09IDApew0KICAgICAgICAgIHZhciBmYWN0b3IgPSBpZ2NsaWVudFdpZHRoIC8gMTg5MDsNCiAgICAgICAgICB6b29tTGV2ZWwgPSB6b29tTGV2ZWwvZmFjdG9yOw0KICAgICAgICAgIHZhciBzY2FsZXggPSAoaWdjbGllbnRXaWR0aCAvIDIpICogem9vbUxldmVsOw0KICAgICAgICAgIHZhciBzY2FsZXkgPSBzY2FsZXg7DQogICAgICAgICAgaWYoeC5pZ3JhcGhsYXlvdXQudHlwZSAhPT0gInNxdWFyZSIpew0KICAgICAgICAgICAgc2NhbGV5ID0gKGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJncmFwaCIrZWwuaWQpLmNsaWVudEhlaWdodCAvIDIpICogem9vbUxldmVsOw0KICAgICAgICAgIH0NCiAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAvLyBjdXJyZW50IGRpdiBub3QgdmlzaWJsZWQuLi4uDQogICAgICAgICAgaWdjbGllbnRXaWR0aCA9IHBhcnNlSW50KGVsX2lkLnN0eWxlLndpZHRoKTsNCiAgICAgICAgICBpZihpZ2NsaWVudFdpZHRoICE9PSAwKXsNCiAgICAgICAgICAgIHZhciBmYWN0b3IgPSBpZ2NsaWVudFdpZHRoIC8gMTg5MDsNCiAgICAgICAgICAgIHpvb21MZXZlbCA9IHpvb21MZXZlbC9mYWN0b3I7DQogICAgICAgICAgICB2YXIgc2NhbGV4ID0gKGlnY2xpZW50V2lkdGggLyAyKSAqIHpvb21MZXZlbDsNCiAgICAgICAgICAgIHZhciBzY2FsZXkgPSBzY2FsZXg7DQogICAgICAgICAgICBpZih4LmlncmFwaGxheW91dC50eXBlICE9PSAic3F1YXJlIil7DQogICAgICAgICAgICAgIHNjYWxleSA9IChwYXJzZUludChlbF9pZC5zdHlsZS5oZWlnaHQpIC8gMikgKiB6b29tTGV2ZWw7DQogICAgICAgICAgICB9DQogICAgICAgICAgfQ0KICAgICAgICB9DQogICAgICAgIA0KICAgICAgICBmb3IgKHZhciBuZCBpbiB0bXBub2Rlcykgew0KICAgICAgICAgIHRtcG5vZGVzW25kXS54ID0gdG1wbm9kZXNbbmRdLnggKiBzY2FsZXg7DQogICAgICAgICAgdG1wbm9kZXNbbmRdLnkgPSB0bXBub2Rlc1tuZF0ueSAqIHNjYWxleTsNCiAgICAgICAgfQ0KICAgICAgfQ0KICAgICAgDQogICAgICBub2Rlcy5hZGQodG1wbm9kZXMpOw0KICAgICAgDQogICAgICB2YXIgdG1wZWRnZXM7DQogICAgICBpZih4LmVkZ2VzVG9EYXRhZnJhbWUpeyAvLyBkYXRhIGluIGRhdGEuZnJhbWUNCiAgICAgICAgdG1wZWRnZXMgPSB2aXNOZXR3b3JrZGF0YWZyYW1lVG9EMyh4LmVkZ2VzLCAiZWRnZXMiKQ0KICAgICAgfSBlbHNlIHsgLy8gZGF0YSBpbiBsaXN0DQogICAgICAgIHRtcGVkZ2VzID0geC5lZGdlczsNCiAgICAgIH0NCiAgICAgIC8vIG9ubHkgb25lIGVsZW1lbnQNCiAgICAgIGlmKHRtcGVkZ2VzICE9PSBudWxsKXsNCiAgICAgICAgaWYodG1wZWRnZXMubGVuZ3RoID09PSB1bmRlZmluZWQpew0KICAgICAgICAgIHRtcGVkZ2VzID0gbmV3IEFycmF5KHRtcGVkZ2VzKTsNCiAgICAgICAgfQ0KICAgICAgICBlZGdlcy5hZGQodG1wZWRnZXMpOy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WxsYmFjaywgImFkZEVkZ2UiKTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgICB9DQogICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICBzYXZlRWRnZShkYXRhLCBjYWxsYmFjaywgImFkZEVkZ2UiKTsNCiAgICAgICAgICB9DQogICAgICAgIH07DQogICAgICB9IGVsc2UgaWYodHlwZW9mKHgub3B0aW9ucy5tYW5pcHVsYXRpb24uYWRkRWRnZSkgPT09IHR5cGVvZih0cnVlKSl7DQogICAgICAgIGlmKHgub3B0aW9ucy5tYW5pcHVsYXRpb24uYWRkRWRnZSl7DQogICAgICAgICAgb3B0aW9ucy5tYW5pcHVsYXRpb24uYWRkRWRnZSA9IGZ1bmN0aW9uKGRhdGEsIGNhbGxiYWNrKSB7DQogICAgICAgICAgICBpZiAoZGF0YS5mcm9tID09IGRhdGEudG8pIHsNCiAgICAgICAgICAgICAgdmFyIHIgPSBjb25maXJtKCJEbyB5b3Ugd2FudCB0byBjb25uZWN0IHRoZSBub2RlIHRvIGl0c2VsZj8iKTsNCiAgICAgICAgICAgICAgaWYgKHIgPT09IHRydWUpIHsNCiAgICAgICAgICAgICAgICBzYXZlRWRnZShkYXRhLCBjYWxsYmFjaywgImFkZEVkZ2UiKTsNCiAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgIHNhdmVFZGdlKGRhdGEsIGNhbGxiYWNrLCAiYWRkRWRnZSIpOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgIH07DQogICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgb3B0aW9ucy5tYW5pcHVsYXRpb24uYWRkRWRnZSA9IGZhbHNlOw0KICAgICAgICB9DQogICAgICB9IGVsc2Ugew0KICAgICAgICBvcHRpb25zLm1hbmlwdWxhdGlvbi5hZGRFZGdlID0geC5vcHRpb25zLm1hbmlwdWxhdGlvbi5hZGRFZGdlOw0KICAgICAgfQ0KDQogICAgICBpZih4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AgICAgICAgICAgIH0NCiAgICAgICAgICAgIH0NCiAgICAgICAgICAgIGVsc2Ugew0KICAgICAgICAgICAgICBzYXZlRWRnZShkYXRhLCBjYWxsYmFjaywgImVkaXRFZGdlIik7DQogICAgICAgICAgICB9DQogICAgICAgICAgfTsNCiAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICBvcHRpb25zLm1hbmlwdWxhdGlvbi5lZGl0RWRnZSA9IGZhbHNlOw0KICAgICAgICB9DQogICAgICB9IGVsc2Ugew0KICAgICAgICBvcHRpb25zLm1hbmlwdWxhdGlvbi5lZGl0RWRnZSA9IHgub3B0aW9ucy5tYW5pcHVsYXRpb24uZWRpdEVkZ2U7DQogICAgICB9DQogICAgfQ0KICAgIA0KICAgIC8vIGNyZWF0ZSBuZXR3b3JrDQogICAgaW5zdGFuY2UubmV0d29yayA9IG5ldyB2aXMuTmV0d29yayhkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgiZ3JhcGgiK2VsLmlkKSwgZGF0YSwgb3B0aW9ucyk7DQogICAgaWYgKHdpbmRvdy5TaGlueSl7DQogICAgICBTaGlueS5vbklucHV0Q2hhbmdlKGVsLmlkICsgJ19pbml0aWFsaXplZCcsIHRydWUpOw0KICAgIH0NCiAgICANCiAgICAvLyoqKioqKioqKioqKioqKioqKioqKioqKioNCiAgICAvL2FkZCB2YWx1ZXMgdG8gaWRzZWxlY3Rpb24NCiAgICAvLyoqKioqKioqKioqKioqKioqKioqKioqKioNCiAgICANCiAgICBpZihlbF9pZC5pZHNlbGVjdGlvbil7ICANCiAgICAgIHZhciBzZWxlY3RMaXN0ID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoIm5vZGVTZWxlY3QiK2VsLmlkKQ0KICAgICAgc2V0Tm9kZUlkTGlzdChzZWxlY3RMaXN0LCB4Lmlkc2VsZWN0aW9uLCBub2RlcykNCiAgICAgIA0KICAgICAgaWYgKHdpbmRvdy5TaGlueSl7DQogICAgICAgIGNoYW5nZUlucHV0K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HgiOw0KICAgICAgICAgIHZpc3BvcHVwLnN0eWxlLmxlZnQgPSB0ZW1wWCArIDUgKyAicHgiOw0KICAgICAgICB9DQogICAgICB9DQogICAgICANCiAgICAgIC8vIGZvciBzcGFya2xpbmUuIEV2YWwgc2NyaXB0Li4uDQogICAgICB2YXIgYW55X3NjcmlwdD0gdmlzcG9wdXAuZ2V0RWxlbWVudHNCeVRhZ05hbWUoJ3NjcmlwdCcpDQogICAgICBmb3IgKHZhciBuID0gMDsgbiA8IGFueV9zY3JpcHQubGVuZ3RoOyBuKyspew0KICAgICAgICBpZihhbnlfc2NyaXB0W25dLmdldEF0dHJpYnV0ZSgidHlwZSIpID09PSAidGV4dC9qYXZhc2NyaXB0Iil7DQogICAgICAgICAgIGV2YWwoYW55X3NjcmlwdFtuXS5pbm5lckhUTUwpOw0KICAgICAgICB9DQogICAgICB9DQogICAgfQ0KICANCiAgICAvLyoqKioqKioqKioqKioqKioqKioqKioqKioNCiAgICAvLyBFdmVudHMNCiAgICAvLyoqKioqKioqKioqKioqKioqKioqKioqKioNCiAgICBpZih4LmV2ZW50cyAhPT0gdW5kZWZpbmVkKXsNCiAgICAgIGZvciAodmFyIGtleSBpbiB4LmV2ZW50cykgew0KICAgICAgICAgIGluc3RhbmNlLm5ldHdvcmsub24oa2V5LCB4LmV2ZW50c1trZXldKTsNCiAgICAgIH0NCiAgICB9DQoNCiAgICBpZih4Lk9uY2VFdmVudHMgIT09IHVuZGVmaW5lZCl7DQogICAgICBmb3IgKHZhciBrZXkgaW4geC5PbmNlRXZlbnRzKSB7DQogICAgICAgICAgaW5zdGFuY2UubmV0d29yay5vbmNlKGtleSwgeC5PbmNlRXZlbnRzW2tleV0pOw0KICAgICAgfQ0KICAgIH0NCiAgICANCiAgICBpZih4LlJlc2V0RXZlbnRzICE9PSB1bmRlZmluZWQpew0KICAgICAgZm9yICh2YXIga2V5IGluIHguUmVzZXRFdmVudHMpIHsNCiAgICAgICAgICBpbnN0YW5jZS5uZXR3b3J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GVkTm9kZSA9IHBhcmFtczsNCiAgICAgICAgICB9DQoNCiAgICAgICAgICB2YXIgdXBkYXRlQXJyYXkgPSBbXTsNCiAgICAgICAgICBpZihlbF9pZC5pZHNlbGVjdGlvbil7DQogICAgICAgICAgICBzZWxlY3ROb2RlID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ25vZGVTZWxlY3QnK2VsLmlkKTsNCiAgICAgICAgICAgIGlmKGlzX2NsdXN0ZXIgPT09IGZhbHNlKXsNCiAgICAgICAgICAgICAgaWYoeC5pZHNlbGVjdGlvbi52YWx1ZXMgIT09IHVuZGVmaW5lZCl7DQogICAgICAgICAgICAgICAgaWYoaW5kZXhPZi5jYWxsKHguaWRzZWxlY3Rpb24udmFsdWVzLCBzZWxlY3RlZE5vZGVbMF0sIHRydWUpID4gLTEpew0KICAgICAgICAgICAgICAgICAgc2VsZWN0Tm9kZS52YWx1ZSA9IHNlbGVjdGVkTm9kZVswXTsNCiAgICAgICAgICAgICAgICB9ZWxzZXsNCiAgICAgICAgICAgICAgICAgIHNlbGVjdE5vZGUudmFsdWUgPSAiIjsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgIH1lbHNlew0KICAgICAgICAgICAgICAgIHNlbGVjdE5vZGUudmFsdWUgPSBzZWxlY3RlZE5vZGVbMF07DQogICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgaWYgKHdpbmRvdy5TaGlueSl7DQogICAgICAgICAgICAgICAgY2hhbmdlSW5wdXQoJ3NlbGVjdGVkJywgc2VsZWN0Tm9kZS52YWx1ZSk7DQogICAgICAgICAgICAgIH0NCiAgICAgICAgICAgIH0NCiAgICAgICAgICB9DQogICAgICAgICAgDQogICAgICAgICAgZWxfaWQuaGlnaGxpZ2h0QWN0aXZlID0gdHJ1ZTsNCiAgICAgICAgICB2YXIgaSxqOw0KICAgICAgICAgIHZhciBkZWdyZWVzID0gZWxfaWQuZGVncmVlOw0KICAgICAgICAgIA0KICAgICAgICAgIC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ROb2RlcyA9IFtdOw0KICAgICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgc2VsZWN0ZWROb2RlLmxlbmd0aDsgaisrKSB7DQogICAgICAgICAgICAgICAgY29ubmVjdGVkTm9kZXMgPSBjb25uZWN0ZWROb2Rlcy5jb25jYXQoaW5zdGFuY2UubmV0d29yay5nZXRDb25uZWN0ZWROb2RlcyhzZWxlY3RlZE5vZGVbal0sIHRydWUpKTsNCiAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICBjb25uZWN0ZWROb2RlcyA9IHVuaXF1ZUFycmF5KGNvbm5lY3RlZE5vZGVzLCB0cnVlLCBpbnN0YW5jZS5uZXR3b3JrKTsNCiAgICAgICAgICAgIH1lbHNlew0KICAgICAgICAgICAgICBjb25uZWN0ZWROb2RlcyA9IHNlbGVjdGVkTm9kZTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgICAgIA0KICAgICAgICAgICAgdmFyIGFsbENvbm5lY3RlZE5vZGVzID0gW107DQogICAgICAgICAgICAvLyBnZXQgdGhlIG5vZGVzIHRvIGNvbG9yDQogICAgICAgICAgICBpZihkZWdyZWVzID49IDIpew0KICAgICAgICAgICAgICBmb3IgKGkgPSAyOyBpIDw9IGRlZ3JlZXM7IGkrKykgew0KICAgICAgICAgICAgICAgIHZhciBwcmV2aW91c19jb25uZWN0ZWROb2RlcyA9IGNvbm5lY3RlZE5vZGVzOw0KICAgICAgICAgICAgICAgIHZhciBjdXJyZW50bGVuZ3RoID0gY29ubmVjdGVkTm9kZXMubGVuZ3RoOw0KICAgICAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCBjdXJyZW50bGVuZ3RoOyBqKyspIHsNCiAgICAgICAgICAgICAgICAgIGNvbm5lY3RlZE5vZGVzID0gdW5pcXVlQXJyYXkoY29ubmVjdGVkTm9kZXMuY29uY2F0KGluc3RhbmNlLm5ldHdvcmsuZ2V0Q29ubmVjdGVkTm9kZXMoY29ubmVjdGVkTm9kZXNbal0pKSwgdHJ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WROb2Rlc1tpXV0ubGFiZWwgPSBhbGxOb2Rlc1thbGxDb25uZWN0ZWROb2Rlc1tpXV0uaGlkZGVuTGFiZWw7DQogICAgICAgICAgICAgICAgICBhbGxOb2Rlc1thbGxDb25uZWN0ZWROb2Rlc1tpXV0uaGlkZGVuTGFiZWwgPSB1bmRlZmluZWQ7DQogICAgICAgICAgICAgICAgICBpZihoYXZlX2NsdXN0ZXJfbm9kZXMpew0KICAgICAgICAgICAgICAgICAgICBpZihpbmRleE9mLmNhbGwobm9kZXNfaW5fY2x1c3RlcnMsIGFsbENvbm5lY3RlZE5vZGVzW2ldLCB0cnVlKSA+IC0xKXsNCiAgDQogICAgICAgICAgICAgICAgICAgICAgYXJyYXlfY2x1c3Rlcl9pZCA9IGFycmF5X2NsdXN0ZXJfaWQuY29uY2F0KGluc3RhbmNlLm5ldHdvcmsuY2x1c3RlcmluZy5maW5kTm9kZShhbGxDb25uZWN0ZWROb2Rlc1tpXSlbMF0pOw0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICB9DQogIA0KICAgICAgICAgICAgICBpZihhcnJheV9jbHVzdGVyX2lkLmxlbmd0aCA+IDApew0KICAgICAgICAgICAgICAgIGFycmF5X2NsdXN0ZXJfaWQgPSB1bmlxdWVBcnJheShhcnJheV9jbHVzdGVyX2lkLCBmYWxzZSwgaW5zdGFuY2UubmV0d29yayk7DQogICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IGFycmF5X2NsdXN0ZXJfaWQubGVuZ3RoOyBpKyspIHsNCiAgICAgICAgICAgICAgICAgIGluc3RhbmNlLm5ldHdvcmsuYm9keS5ub2Rlc1thcnJheV9jbHVzdGVyX2lkW2ldXS5zZXRPcHRpb25zKHtsYWJlbCA6IGluc3RhbmNlLm5ldHdvcmsuYm9keS5ub2Rlc1thcnJheV9jbHVzdGVyX2lkW2ldXS5vcHRpb25zLmhpZGRlbk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b3B0aW9ucywgaW5zdGFuY2UubmV0d29yayk7DQogICAgICAgICAgICAgIGlmKGhhdmVfY2x1c3Rlcl9ub2Rlcyl7DQogICAgICAgICAgICAgICAgaWYoaW5kZXhPZi5jYWxsKG5vZGVzX2luX2NsdXN0ZXJzLCBjb25uZWN0ZWROb2Rlc1tpXSwgdHJ1ZSkgPiAtMSl7DQogICAgICAgICAgICAgICAgICBhcnJheV9jbHVzdGVyX2lkID0gYXJyYXlfY2x1c3Rlcl9pZC5jb25jYXQoaW5zdGFuY2UubmV0d29yay5jbHVzdGVyaW5nLmZpbmROb2RlKGNvbm5lY3RlZE5vZGVzW2ldKVswXSk7DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICB9DQogICAgICAgICAgICB9DQogICAgICAgICAgICANCiAgICAgICAgICAgIGlmKGFycmF5X2NsdXN0ZXJfaWQubGVuZ3RoID4gMCl7DQogICAgICAgICAgICAgIGFycmF5X2NsdXN0ZXJfaWQgPSB1bmlxdWVBcnJheShhcnJheV9jbHVzdGVyX2lkLCBmYWxzZSwgaW5zdGFuY2UubmV0d29yayk7DQogICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBhcnJheV9jbHVzdGVyX2lkLmxlbmd0aDsgaSsrKSB7DQogICAgICAgICAgICAgICAgcmVzZXRPbmVDbHVzdGVyKGluc3RhbmNlLm5ldHdvcmsuYm9keS5ub2Rlc1thcnJheV9jbHVzdGVyX2lkW2ldXSwgaW5zdGFuY2UubmV0d29yay5ncm91cHMsIG9wdGlvbnMsIGluc3RhbmNlLm5ldHdvcmspOw0KICAgICAgICAgICAgICB9DQogICAgICAgICAgICB9DQogICAgICAgICAgICANCiAgICAgICAgICAgIC8vIHNldCBzb21lIGVkZ2VzIGFzIGhhcmQgdG8gcmVhZA0KICAgICAgICAgICAgdmFyIGVkZ2VzSGFyZFRvUmVhZCA9IGVkZ2VzLmdldCh7DQogICAgICAgICAgICAgIGZpZWxkczogWydpZCcsICdjb2xvcicsICdoa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9tLCBkZWdyZWVfdG8pOw0KICAgICAgICAgICAgDQogICAgICAgICAgICB2YXIgYWxsQ29ubmVjdGVkTm9kZXMgPSBbXTsNCiAgICAgICAgICAgIHZhciBjdXJyZW50Q29ubmVjdGVkRnJvbU5vZGVzID0gW107DQogICAgICAgICAgICB2YXIgY3VycmVudENvbm5lY3RlZFRvTm9kZXMgPSBbXTsNCiAgICAgICAgICAgIHZhciBjb25uZWN0ZWRGcm9tTm9kZXMgPSBbXTsNCiAgICAgICAgICAgIHZhciBjb25uZWN0ZWRUb05vZGVzID0gW107DQogICAgICAgICAgICANCiAgICAgICAgICAgIGlmKGRlZ3JlZV9mcm9tID4gMCl7DQogICAgICAgICAgICAgIGNvbm5lY3RlZEZyb21Ob2RlcyA9IGVkZ2VzLmdldCh7DQogICAgICAgICAgICAgICAgZmllbGRzOiBbJ2Zyb20nXSwNCiAgICAgICAgICAgICAgICBmaWx0ZXI6IGZ1bmN0aW9uIChpdGVtKSB7DQogICAgICAgICAgICAgICAgICByZXR1cm4gKChpbmRleE9mLmNhbGwoc2VsZWN0ZWROb2RlLCBpdGVtLnRvLCB0cnVlKSAhPT0gLTEpKSA7DQogICAgICAgICAgICAgICAgfSwNCiAgICAgICAgICAgICAgICByZXR1cm5UeXBlIDonQXJyYXknDQogICAgICAgICAgICAgIH0pOw0KICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICBpZihkZWdyZWVfdG8gPiAwKXsNCiAgICAgICAgICAgICAgY29ubmVjdGVkVG9Ob2RlcyA9IGVkZ2VzLmdldCh7DQogICAgICAgICAgICAgICAgZmllbGRzOiBbJ3RvJ10sDQogICAgICAgICAgICAgICAgZmlsdGVyOiBmdW5jdGlvbiAoaXRlbSkgew0KICAgICAgICAgICAgICAgICAgcmV0dXJuICgoaW5kZXhPZi5jYWxsKHNlbGVjdGVkTm9kZSwgaXRlbS5mcm9tLCB0cnVlKSAhPT0gLTEpKSA7DQogICAgICAgICAgICAgICAgfSwNCiAgICAgICAgICAgICAgICByZXR1cm5UeXBlIDonQXJyYXknDQogICAgICAgICAgICAgIH0pOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IGNvbm5lY3RlZEZyb21Ob2Rlcy5sZW5ndGg7IGorKykgew0KICAgICAgICAgICAgICAgIGFsbENvbm5lY3RlZE5vZGVzID0gYWxsQ29ubmVjdGVkTm9kZXMuY29uY2F0KGNvbm5lY3RlZEZyb21Ob2Rlc1tqXS5mcm9tKTsNCiAgICAgICAgICAgICAgICBjdXJyZW50Q29ubmVjdGVkRnJvbU5vZGVzID0gY3VycmVudENvbm5lY3RlZEZyb21Ob2Rlcy5jb25jYXQoY29ubmVjdGVkRnJvbU5vZGVzW2pdLmZyb20pOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgDQogICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgY29ubmVjdGVkVG9Ob2Rlcy5sZW5ndGg7IGorKykgew0KICAgICAgICAgICAgICAgIGFsbENvbm5lY3RlZE5vZGVzID0gYWxsQ29ubmVjdGVkTm9kZXMuY29uY2F0KGNvbm5lY3RlZFRvTm9kZXNbal0udG8pOw0KICAgICAgICAgICAgICAgIGN1cnJlbnRDb25uZWN0ZWRUb05vZGVzID0gY3VycmVudENvbm5lY3RlZFRvTm9kZXMuY29uY2F0KGNvbm5lY3RlZFRvTm9kZXNbal0udG8pOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgDQogICAgICAgICAgICB2YXIgZ29fZnJvbTsNCiAgICAgICAgICAgIHZhciBnb190bzsNCiAgICAgICAgICAgICAgICANCiAgICAgICAgICAgIGlmKGRlZ3JlZXMgPiAxKXsNCiAgICAgICAgICAgICAgZm9yIChpID0gMjsgaSA8PSBkZWdyZWVzOyBpKyspIHsNCiAgICAgICAgICAgICAgICBnb19mcm9tID0gZmFsc2U7DQogICAgICAgICAgICAgICAgZ29fdG8gPSBmYWxzZTsNCiAgICAgICAgICAgICAgICBpZihjdXJyZW50Q29ubmVjdGVkRnJvbU5vZGVzLmxlbmd0aCA+IDAgJiYgaSA8PSBkZWdyZWVfZnJvbSl7DQogICAgICAgICAgICAgICAgICBjb25uZWN0ZWRGcm9tTm9kZXMgPSBlZGdlcy5nZXQoew0KICAgICAgICAgICAgICAgICAgICBmaWVsZHM6IFsnZnJvbSddLA0KICAgICAgICAgICAgICAgICAgICBmaWx0ZXI6IGZ1bmN0aW9uIChpdGVtKSB7DQogICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGluZGV4T2YuY2FsbChjdXJyZW50Q29ubmVjdGVkRnJvbU5vZGVzLCBpdGVtLnRvLCB0cnVlKSA+IC0xOw0KICAgICAgICAgICAgICAgICAgICB9LA0KICAgICAgICAgICAgICAgICAgICByZXR1cm5UeXBlIDonQXJyYXknDQogICAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICAgIGdvX2Zyb20gPSB0cnVlOw0KICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgIGlmKGN1cnJlbnRDb25uZWN0ZWRUb05vZGVzLmxlbmd0aCA+IDAgJiYgaSA8PSBkZWdyZWVfdG8pew0KICAgICAgICAgICAgICAgICAgY29ubmVjdGVkVG9Ob2RlcyA9IGVkZ2VzLmdldCh7DQogICAgICAgICAgICAgICAgICAgIGZpZWxkczogWyd0byddLA0KICAgICAgICAgICAgICAgICAgICBmaWx0ZXI6IGZ1bmN0aW9uIChpdGVtKSB7DQogICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGluZGV4T2YuY2FsbChjdXJyZW50Q29ubmVjdGVkVG9Ob2RlcywgaXRlbS5mcm9tLCB0cnVlKSA+IC0xOw0KICAgICAgICAgICAgICAgICAgICB9LA0KICAgICAgICAgICAgICAgICAgICByZXR1cm5UeXBlIDonQXJyYXknDQogICAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICAgIGdvX3RvID0gdHJ1ZTsNCiAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICBpZihnb19mcm9tID09PSB0cnVlKXsNCiAgICAgICAgICAgICAgICAgIGN1cnJlbnRDb25uZWN0ZWRGcm9tTm9kZXMgPSBbXTsNCiAgICAgICAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCBjb25uZWN0ZWRGcm9tTm9kZXMubGVuZ3RoOyBqKyspIHsNCiAgICAgICAgICAgICAgICAgICAgYWxsQ29ubmVjdGVkTm9kZXMgPSBhbGxDb25uZWN0ZWROb2Rlcy5jb25jYXQoY29ubmVjdGVkRnJvbU5vZGVzW2pdLmZyb20pOw0KICAgICAgICAgICAgICAgICAgICBjdXJyZW50Q29ubmVjdGVkRnJvbU5vZGVzID0gY3VycmVudENvbm5lY3RlZEZyb21Ob2Rlcy5jb25jYXQoY29ubmVjdGVkRnJvbU5vZGVzW2pdLmZyb20pOw0KICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgICAgICAgIGlmKGdvX3RvID09PSB0cnVlKXsNCiAgICAgICAgICAgICAgICAgIGN1cnJlbnRDb25uZWN0ZWRUb05vZGVzID0gW107DQogICAgICAgICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgY29ubmVjdGVkVG9Ob2Rlcy5sZW5ndGg7IGorKykgew0KICAgICAgICAgICAgICAgICAgICBhbGxDb25uZWN0ZWROb2RlcyA9IGFsbENvbm5lY3RlZE5vZGVzLmNvbmNhdChjb25uZWN0ZWRUb05vZGVzW2pdLnRvKTsNCiAgICAgICAgICAgICAgICAgICAgY3VycmVudENvbm5lY3RlZFRvTm9kZXMgPSBjdXJyZW50Q29ubmVjdGVkVG9Ob2Rlcy5jb25jYXQoY29ubmVjdGVkVG9Ob2Rlc1tqXS50byk7DQogICAgICAgICAgICAgICAgICB9IA0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICANCiAgICAgICAgICAgICAgICBpZiAoZ29fZnJvbSA9PT0gZmFsc2UgJiYgIGdvX3RvID09PSBmYWxzZSkgeyBicmVhazt9DQogICAgICAgICAgICAgIH0NCiAgICAgICAgICAgIH0NCiAgICAgICAgICAgIA0KICAgICAgICAgICAgYWxsQ29ubmVjdGVkTm9kZXMgPSB1bmlxdWVBcnJheShhbGxDb25uZWN0ZWROb2RlcywgdHJ1ZSwgaW5zdGFuY2UubmV0d29yaykuY29uY2F0KHNlbGVjdGVkTm9kZSk7DQoNCiAgICAgICAgICAgIHZhciBub2Rlc1dpdGhMYWJlbCA9IFtdOw0KICAgICAgICAgICAgaWYoZWxfaWQuaGlnaGxpZ2h0TGFiZWxPbmx5ID09PSB0cnVlKXsNCiAgICAgICAgICAgICAgaWYoZGVncmVlcyA+IDApew0KICAgICAgICAgICAgICAgIC8vIG5vZGVzIHRvIGp1c3QgbGFiZWwNCiAgICAgICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgY3VycmVudENvbm5lY3RlZFRvTm9kZXMubGVuZ3RoOyBqKyspIHsNCiAgICAgICAgICAgICAgICAgICAgbm9kZXNXaXRoTGFiZWwgPSBub2Rlc1dpdGhMYWJlbC5jb25jYXQoaW5zdGFuY2UubmV0d29yay5nZXRDb25uZWN0ZWROb2RlcyhjdXJyZW50Q29ubmVjdGVkVG9Ob2Rlc1tqXSkpOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICANCiAgICAgICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgY3VycmVudENvbm5lY3RlZEZyb21Ob2Rlcy5sZW5ndGg7IGorKykgew0KICAgICAgICAgICAgICAgICAgICBub2Rlc1dpdGhMYWJlbCA9IG5vZGVzV2l0aExhYmVsLmNvbmNhdChpbnN0YW5jZS5uZXR3b3JrLmdldENvbm5lY3RlZE5vZGVzKGN1cnJlbnRDb25uZWN0ZWRGcm9tTm9kZXNbal0pKTsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgbm9kZXNXaXRoTGFiZWwgPSB1bmlxdWVBcnJheShub2Rlc1dpdGhMYWJlbCwgdHJ1Z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55Lm9uSW5wdXRDaGFuZ2UoZWwuaWQgKyAnX2hpZ2hsaWdodF9jb2xvcl9pZCcsIHVuaXF1ZVNoaW55KGFsbENvbm5lY3RlZE5vZGVzKSk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBpZihlbF9pZC5oaWdobGlnaHRMYWJlbE9ubHkgPT09IHRydWUpew0KICAgICAgICAgICAgICBpZiAod2luZG93LlNoaW55KXsNCiAgICAgICAgICAgICAgICBTaGlueS5vbklucHV0Q2hhbmdlKGVsLmlkICsgJ19oaWdobGlnaHRfbGFiZWxfaWQnLCBub2Rlc1dpdGhMYWJlbC5maWx0ZXIoZnVuY3Rpb24oeCkge3JldHVybiAhYWxsQ29ubmVjdGVkTm9kZXMuaW5jbHVkZXMoeCl9KSk7DQogICAgICAgICAgICAgIH0NCiAgICAgICAgICAgIH0gIA0KICAgICAgICAgICAgDQogICAgICAgICAgICAvLyBzZXQgc29tZSBlZGdlcyBhcyBoYXJkIHRvIHJlYWQNCiAgICAgICAgICAgIHZhciBlZGdlc0hhcmRUb1JlYWQgPSBlZGdlcy5nZXQoew0KICAgICAgICAgICAgICBmaWVsZHM6IFsnaWQnLCAnY29sb3InLCAnaGlkZGVuQ29sb3InLCAnaGlkZGVuTGFiZWwnLCAnbGFiZWwnXSwNCiAgICAgICAgICAgICAgZmlsdGVyOiBmdW5jdGlvbiAoaXRlbSkgew0KICAgICAgICAgICAgICAgIHJldHVybiAoKGluZGV4T2YuY2FsbChhbGxDb25uZWN0ZWROb2RlcywgaXRlbS5mcm9tLCB0cnVlKSA9PT0gLTEpICB8fCAoaW5kZXhPZi5jYWxsKGFsbENvbm5lY3RlZE5vZGVzLCBpdGVtLnRvLCB0cnVlKSA9PT0gLTEpKSA7DQogICAgICAgICAgICAgIH0sDQogICAgICAgICAgICAgIHJldHVyblR5cGUgOidBcnJheScNCiAgICAgICAgICAgIH0pOw0KDQogICAgICAgICAgICBhcnJheV9jbHVzdGVyX2lkID0gW107DQogICAgICAgICAgICB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ICAgICAgICAgICAgICBlZGdlQXNIYXJkVG9SZWFkKGluc3RhbmNlLm5ldHdvcmsuYm9keS5lZGdlc1thcnJheV9jbHVzdGVyX2lkW2ldXS5vcHRpb25zLCBlbF9pZC5oaWdobGlnaHRDb2xvciwgZWxfaWQuYnlzZWxlY3Rpb25Db2xvciwgaW5zdGFuY2UubmV0d29yaywgdHlwZSA9ICJjbHVzdGVyIik7DQogICAgICAgICAgICAgIH0NCiAgICAgICAgICAgIH0NCiAgICAgICAgICAgIA0KICAgICAgICAgICAgZWRnZXMudXBkYXRlKGVkZ2VzSGFyZFRvUmVhZCk7DQogICAgICAgICAgICANCiAgICAgICAgICB9DQoNCiAgICAgICAgICBpZih1cGRhdGUpew0KICAgICAgICAgICAgaWYoIShhY3Rpb25fdHlwZSA9PSAiaG92ZXIiKSl7DQogICAgICAgICAgICAgICBpc19jbGlja2VkID0gdHJ1ZTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgICAgIC8vIHRyYW5zZm9ybSB0aGUgb2JqZWN0IGludG8gYW4gYXJyYXkNCiAgICAgICAgICAgIHZhciB1cGRhdGVBcnJheSA9IFtdOw0KICAgICAgICAgICAgZm9yIChub2RlSWQgaW4gYWxsTm9kZXMpIHsNCiAgICAgICAgICAgICAgaWYgKGFsbE5vZGVzLmhhc093blByb3BlcnR5KG5vZGVJZCkpIHsNCiAgICAgICAgICAgICAgICB1cGRhdGVBcnJheS5wdXNoKGFsbE5vZGVzW25vZGVJZF0pOw0KICAgICAgICAgICAgICB9DQogICAgICAgICAgICB9DQogICAgICAgICAgICBub2Rlcy51cGRhdGUodXBkYXRlQXJyYXkpOw0KICAgICAgICAgIH1lbHNlew0KICAgICAgICAgICAgaXNfY2xpY2tlZCA9IGZhbHNlOw0KICAgICAgICAgIH0NCiAgICAgICAgDQogICAgICAgIH0NCiAgICAgICAgZWxzZSBpZiAoZWxfaWQuaGlnaGxpZ2h0QWN0aXZlID09PSB0cnVlIHwgZWxfaWQuc2VsZWN0QWN0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YXJlbnQiICYmIHguYmFja2dyb3VuZCAhPT0gInJnYmEoMCwgMCwgMCwgMCkiKXsNCiAgICAgICAgZXhwb3J0X2JhY2tncm91bmQgPSB4LmJhY2tncm91bmQNCiAgICAgIH0NCiAgICAgIA0KICAgICAgaWYoeC5leHBvcnQudHlwZSAhPT0gInBkZiIpew0KICAgICAgICBodG1sMmNhbnZhcyhlbF9pZCwgew0KICAgICAgICAgIGJhY2tncm91bmQ6IGV4cG9ydF9iYWNrZ3JvdW5kLA0KICAgICAgICAgIGhlaWdodCA6IGFkZEhlaWdodEV4cG9ydCwNCiAgICAgICAgICBvbnJlbmRlcmVkOiBmdW5jdGlvbihjYW52YXMpIHsNCiAgICAgICAgICAgIGNhbnZhcy50b0Jsb2JIRChmdW5jdGlvbihibG9iKSB7DQogICAgICAgICAgICAgIHNhdmVBcyhibG9iLCB4LmV4cG9ydC5uYW1lKTsNCiAgICAgICAgICAgIH0sICJpbWFnZS8iK3guZXhwb3J0LnR5cGUpOw0KICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgICB9IGVsc2Ugew0KICAgICAgICBodG1sMmNhbnZhcyhlbF9pZCwgew0KICAgICAgICAgIGJhY2tncm91bmQ6IGV4cG9ydF9iYWNrZ3JvdW5kLA0KICAgICAgICAgIGhlaWdodCA6IGFkZEhlaWdodEV4cG9ydCwNCiAgICAgICAgICBvbnJlbmRlcmVkOiBmdW5jdGlvbihjYW52YXMpIHsNCiAgICAgICAgICAgIHZhciBteUltYWdlID0gY2FudmFzLnRvRGF0YVVSTCgiaW1hZ2UvcG5nIiwgMS4wKTsNCiAgICAgICAgICAgIC8vdmFyIGltZ1dpZHRoID0gKGNhbnZhcy53aWR0aCAqIDI1LjQpIC8gMjQ7DQogICAgICAgICAgICAvL3ZhciBpbWdIZWlnaHQgPSAoY2FudmFzLmhlaWdodCAqIDI1LjQpIC8gMjQ7IA0KICAgICAgICAgICAgdmFyIHRhYmxlID0gbmV3IGpzUERGKCdsJywgJ3B0Jyw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J5Q29ubmVjdGlvbigpOw0KICAgIH0NCiAgICANCiAgICAvLyoqKioqKioqKioqKioqKioqKioqKioqKioNCiAgICAvL2NsdXN0ZXJpbmcgaHVic2l6ZQ0KICAgIC8vKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIGlmKHguY2x1c3RlcmluZ0h1YnNpemUpew0KICAgICAgDQogICAgICBmdW5jdGlvbiBjbHVzdGVyQnlIdWJzaXplKCkgew0KICAgICAgICB2YXIgY2x1c3Rlck9wdGlvbnNCeURhdGEgPSB7DQogICAgICAgICAgcHJvY2Vzc1Byb3BlcnRpZXM6IGZ1bmN0aW9uKGNsdXN0ZXJPcHRpb25zLCBjaGlsZE5vZGVzKSB7DQogICAgICAgICAgICB2YXIgY2x1c3Rlcl9sZXZlbCA9IDk5OTk5OTkNCiAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgY2hpbGROb2Rlcy5sZW5ndGg7IGkrKykgew0KICAgICAgICAgICAgICAgICAgICAgIC8vdG90YWxNYXNzICs9IGNoaWxkTm9kZXNbaV0ubWFzczsNCiAgICAgICAgICAgICAgICAgICAgICBpZihjaGlsZE5vZGVzW2ldLmxldmVsKXsNCiAgICAgICAgICAgICAgICAgICAgICAgIGNsdXN0ZXJfbGV2ZWwgPSBNYXRoLm1pbihjbHVzdGVyX2xldmVsLCBjaGlsZE5vZGVzW2ldLmxldmVsKQ0KICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICBpZihpID09PSAwKXsNCiAgICAgICAgICAgICAgICAgICAgICAgIC8vY2x1c3Rlck9wdGlvbnMuc2hhcGUgPSAgY2hpbGROb2Rlc1tpXS5zaGFwZTsNCiAgICAgICAgICAgICAgICAgICAgICAgIGNsdXN0ZXJPcHRpb25zLmNvbG9yID0gIGNoaWxkTm9kZXNbaV0uY29sb3IuYmFja2dyb3VuZDsNCiAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsNCiAgICAgICAgICAgICAgICAgICAgICAgIC8vaWYoY2hpbGROb2Rlc1tpXS5zaGFwZSAhPT0gY2x1c3Rlck9wdGlvbnMuc2hhcGUpew0KICAgICAgICAgICAgICAgICAgICAgICAgICAvL2NsdXN0ZXJPcHRpb25zLnNoYXBlID0gJ2RhdGFiYXNlJzsNCiAgICAgICAgICAgICAgICAgICAgICAgIC8vfQ0KICAgICAgICAgICAgICAgICAgICAgICAgaWYoY2hpbGROb2Rlc1tpXS5jb2xvci5iYWNrZ3JvdW5kICE9PSBjbHVzdGVyT3B0aW9ucy5jb2xvcil7DQogICAgICAgICAgICAgICAgICAgICAgICAgIGNsdXN0ZXJPcHRpb25zLmNvbG9yID0gJ2dyZXknOw0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgIGNsdXN0ZXJPcHRpb25zLmxhYmVsID0gIlsiICsgY2hpbGROb2Rlcy5sZW5ndGggKyAiXSI7DQogICAgICAgICAgICBpZihjbHVzdGVyX2xldmVsICE9PSA5OTk5OTk5KXsNCiAgICAgICAgICAgICAgY2x1c3Rlck9wdGlvbnMubGV2ZWwgPSBjbHVzdGVyX2xldmVsDQogICAgICAgICAgICB9DQogICAgICAgICAgICByZXR1cm4gY2x1c3Rlck9wdGlvbnM7DQogICAgICAgICAgfSwNCiAgICAgICAgICBjbHVzdGVyTm9kZVByb3BlcnRpZXM6IHtib3JkZXJXaWR0aDozLCBzaGFwZTonYm94JywgZm9udDp7c2l6ZTozMH19DQogICAgICAgIH0NCiAgICAgICAgaWYoeC5jbHVzdGVyaW5nSHVic2l6ZS5zaXplID4gMCl7DQogICAgICAgICAgaW5zdGFuY2UubmV0d29yay5jbHVzdGVyQnlIdWJzaXplKHguY2x1c3RlcmluZ0h1YnNpemUuc2l6ZSwgY2x1c3Rlck9wdGlvbnNCeURhdGEpOw0KICAgICAgICB9ZWxzZXsNCiAgICAgICAgICBpbnN0YW5jZS5uZXR3b3JrLmNsdXN0ZXJCeUh1YnNpemUodW5kZWZpbmVkLCBjbHVzdGVyT3B0aW9uc0J5RGF0YSk7DQogICAgICAgIH0NCiAgICAgIH0NCiAgICAgIA0KICAgICAgY2x1c3RlckJ5SHVic2l6ZSgpOw0KICAgIH0NCiAgICANCiAgICBpZih4LmNsdXN0ZXJpbmdDb2xvcil7DQogICAgICANCiAgICAvLyoqKioqKioqKioqKioqKioqKioqKioqKioNCiAgICAvL2NsdXN0ZXJpbmcgY29sb3INCiAgICAvLyoqKioqKioqKioqKioqKioqKioqKioqKioNCiAgICBmdW5jdGlvbiBjbHVzdGVyQnlDb2xvcigpIHsNCiAgICAgICAgdmFyIGNvbG9ycyA9IHguY2x1c3RlcmluZ0NvbG9yLmNvbG9ycw0KICAgICAgICB2YXIgY2x1c3Rlck9wdGlvbnNCeURhdGE7DQogICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgY29sb3JzLmxlbmd0aDsgaSsrKSB7DQogICAgICAgICAgdmFyIGNvbG9yID0gY29sb3JzW2ldOw0KICAgICAgICAgIHZhciBzaCA9IHguY2x1c3RlcmluZ0NvbG9yLnNoYXBlW2ldOw0KICAgICAgICAgIHZhciBmb3JjZSA9IHguY2x1c3RlcmluZ0NvbG9yLmZvcmNlW2ldOw0KICAgICAgICAgIGNsdXN0ZXJPcHRpb25zQnlEYXRhID0gew0KICAgICAgICAgICAgICBqb2luQ29uZGl0aW9uOiBmdW5jdGlvbiAoY2hpbGRPcHRpb25zKSB7DQogICAgICAgICAgICAgICAgICByZXR1cm4gY2hpbGRPcHRpb25zLmNvbG9yLmJhY2tncm91bmQgPT0gY29sb3I7IC8vIHRoZSBjb2xvciBpcyBmdWxseSBkZWZpbmVkIGluIHRoZSBub2RlLg0KICAgICAgICAgICAgICB9LA0KICAgICAgICAgICAgICBwcm9jZXNzUHJvcGVydGllczogZnVuY3Rpb24gKGNsdXN0ZXJPcHRpb25zLCBjaGlsZE5vZGVzLCBjaGlsZEVkZ2VzKSB7DQogICAgICAgICAgICAgICAgICB2YXIgdG90YWxNYXNzID0gMDsNCiAgICAgICAgICAgICAgICAgIHZhciBjbHVzdGVyX2xldmVsID0gOTk5OTk5OTsNCiAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgY2hpbGROb2Rlcy5sZW5ndGg7IGkrKykgew0KICAgICAgICAgICAgICAgICAgICAgIHRvdGFsTWFzcyArPSBjaGlsZE5vZGVzW2ldLm1hc3M7DQogICAgICAgICAgICAgICAgICAgICAgaWYoY2hpbGROb2Rlc1tpXS5sZXZlbCl7DQogICAgICAgICAgICAgICAgICAgICAgICBjbHVzdGVyX2xldmVsID0gTWF0aC5taW4oY2x1c3Rlcl9sZXZlbCwgY2hpbGROb2Rlc1tpXS5sZXZlbCkNCiAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgaWYoZm9yY2UgPT09IGZhbHNlKXsNCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGkgPT09IDApew0KICAgICAgICAgICAgICAgICAgICAgICAgICBjbHVzdGVyT3B0aW9ucy5zaGFwZSA9ICBjaGlsZE5vZGVzW2ldLnNoYXBlOw0KICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7DQogICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGNoaWxkTm9kZXNbaV0uc2hhcGUgIT09IGNsdXN0ZXJPcHRpb25zLnNoYXBlKXsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbHVzdGVyT3B0aW9ucy5zaGFwZSA9IHNoOw0KICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIGNsdXN0ZXJPcHRpb25zLnNoYXBlID0gc2g7DQogICAgICAgICAgICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICBjbHVzdGVyT3B0aW9ucy52YWx1ZSA9IHRvdGFsTWFzczsNCiAgICAgICAgICAgICAgICAgIGlmKGNsdXN0ZXJfbGV2ZWwgIT09IDk5OTk5OTkpew0KICAgICAgICAgICAgICAgICAgICBjbHVzdGVyT3B0aW9ucy5sZXZlbCA9IGNsdXN0ZXJfbGV2ZWwNCiAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgIHJldHVybiBjbHVzdGVyT3B0aW9uczsNCiAgICAgICAgICAgICAgfSwNCiAgICAgICAgICAgICAgY2x1c3Rlck5vZGVQcm9wZXJ0aWVzOiB7aWQ6ICdjbHVzdGVyOicgKyBjb2xvciwgYm9yZGVyV2lkdGg6IDMsIGNvbG9yOmNvbG9yLCBsYWJlbDogeC5jbHVzdGVyaW5nQ29sb3IubGFiZWwgKyBjb2xvcn0NCiAgICAgICAgICB9DQogICAgICAgICAgaW5zdGFuY2UubmV0d29yay5jbHVzdGVyKGNsdXN0ZXJPcHRpb25zQnlEYXRhKTsNCiAgICAgICAgfQ0KICAgICAgfQ0KICAgICAgDQogICAgICBjbHVzdGVyQnlDb2xvcigpOw0KICAgIH0NCg0KICAgIC8vKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIC8vY2x1c3RlcmluZyBncm91cHMNCiAgICAvLyoqKioqKioqKioqKioqKioqKioqKioqKioNCiAgICBpZih4LmNsdXN0ZXJpbmdHcm91cCl7DQogICAgICANCiAgICAgIGZ1bmN0aW9uIGNsdXN0ZXJCeUdyb3VwKCkgew0KICAgICAgICB2YXIgZ3JvdXBzID0geC5jbHVzdGVyaW5nR3JvdXAuZ3JvdXBzOw0KICAgICAgICB2YXIgY2x1c3Rlck9wdGlvbnNCeURhdGE7DQogICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZ3JvdXBzLmxlbmd0aDsgaSsrKSB7DQogICAgICAgICAgdmFyIGdyb3VwID0gZ3JvdXBzW2ldOw0KICAgICAgICAgIHZhciBjb2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ICBpZihmb3JjZSA9PT0gZmFsc2Upew0KICAgICAgICAgICAgICAgICAgICAgICAgaWYoaSA9PT0gMCl7DQogICAgICAgICAgICAgICAgICAgICAgICAgIGNsdXN0ZXJPcHRpb25zLnNoYXBlID0gIGNoaWxkTm9kZXNbaV0uc2hhcGU7DQogICAgICAgICAgICAgICAgICAgICAgICAgIGNsdXN0ZXJPcHRpb25zLmNvbG9yID0gIGNoaWxkTm9kZXNbaV0uY29sb3IuYmFja2dyb3VuZDsNCiAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlew0KICAgICAgICAgICAgICAgICAgICAgICAgICBpZihjaGlsZE5vZGVzW2ldLnNoYXBlICE9PSBjbHVzdGVyT3B0aW9ucy5zaGFwZSl7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgY2x1c3Rlck9wdGlvbnMuc2hhcGUgPSBzaDsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICBpZihjaGlsZE5vZGVzW2ldLmNvbG9yLmJhY2tncm91bmQgIT09IGNsdXN0ZXJPcHRpb25zLmNvbG9yKXsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbHVzdGVyT3B0aW9ucy5jb2xvciA9IGNvbDsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICAgICAgICAgICAgICBjbHVzdGVyT3B0aW9ucy5zaGFwZSA9IHNoOw0KICAgICAgICAgICAgICAgICAgICAgICAgY2x1c3Rlck9wdGlvbnMuY29sb3IgPSBjb2w7DQogICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgaWYoc2Nfc2l6ZSl7DQogICAgICAgICAgICAgICAgICAgICBjbHVzdGVyT3B0aW9ucy52YWx1ZSA9IHRvdGFsTWFzczsNCiAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgIGlmKGNsdXN0ZXJfbGV2ZWwgIT09IDk5OTk5OTkpew0KICAgICAgICAgICAgICAgICAgICBjbHVzdGVyT3B0aW9ucy5sZXZlbCA9IGNsdXN0ZXJfbGV2ZWwNCiAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgIHJldHVybiBjbHVzdGVyT3B0aW9uczsNCiAgICAgICAgICAgICAgfSwNCiAgICAgICAgICAgICAgY2x1c3Rlck5vZGVQcm9wZXJ0aWVzOiB7aWQ6ICdjbHVzdGVyOicgKyBncm91cCwgYm9yZGVyV2lkdGg6IDMsIGxhYmVsOnguY2x1c3RlcmluZ0dyb3VwLmxhYmVsICsgZ3JvdXB9DQogICAgICAgICAgfQ0KICAgICAgICAgIGluc3RhbmNlLm5ldHdvcmsuY2x1c3RlcihjbHVzdGVyT3B0aW9uc0J5RGF0YSk7DQogICAgICAgIH0NCiAgICAgIH0NCiAgICAgIGNsdXN0ZXJCeUdyb3VwKCk7DQogICAgfQ0KICANCiAgICAvLyoqKioqKioqKioqKioqKioqKioqKioqKioNCiAgICAvL2NsdXN0ZXJpbmcgYnkgem9vbQ0KICAgIC8vKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIGlmKHguY2x1c3RlcmluZ091dGxpZXJzKXsNCiAgICAgIA0KICAgICAgY2x1c3RlckZhY3RvciA9IHguY2x1c3RlcmluZ091dGxpZXJzLmNsdXN0ZXJGYWN0b3I7DQogICAgICANCiAgICAgIC8vIHNldCB0aGUgZmlyc3QgaW5pdGlhbCB6b29tIGxldmVsDQogICAgICBpbnN0YW5jZS5uZXR3b3JrLm9uKCdpbml0UmVkcmF3JywgZnVuY3Rpb24oKSB7DQogICAgICAgIGlmIChsYXN0Q2x1c3Rlclpvb21MZXZlbCA9PT0gMCkgew0KICAgICAgICAgIGxhc3RDbHVzdGVyWm9vbUxldmVsID0gaW5zdGFuY2UubmV0d29yay5nZXRTY2FsZSgpOw0KICAgICAgICB9DQogICAgICB9KTsNCg0KICAgICAgLy8gd2UgdXNlIHRoZSB6b29tIGV2ZW50IGZvciBvdXIgY2x1c3RlcmluZw0KICAgICAgaW5zdGFuY2UubmV0d29yay5vbignem9vbScsIGZ1bmN0aW9uIChwYXJhbXMpIHsNCiAgICAgICAgaWYoY3RybHdhaXQgPT09IDApew0KICAgICAgICBpZiAocGFyYW1zLmRpcmVjdGlvbiA9PSAnLScpIHsNCiAgICAgICAgICBpZiAocGFyYW1zLnNjYWxlIDwgbGFzdENsdXN0ZXJab29tTGV2ZWwqY2x1c3RlckZhY3Rvcikgew0KICAgICAgICAgICAgbWFrZUNsdXN0ZXJzKHBhcmFtcy5zY2FsZSk7DQogICAgICAgICAgICBsYXN0Q2x1c3Rlclpvb21MZXZlbCA9IHBhcmFtcy5zY2FsZTsNCiAgICAgICAgICB9DQogICAgICAgIH0NCiAgICAgICAgZWxzZSB7DQogICAgICAgICAgb3BlbkNsdXN0ZXJzKHBhcmFtcy5zY2FsZSk7DQogICAgICAgIH0NCiAgICAgICAgfQ0KICAgICAgfSk7DQogICAgfQ0KDQogICAgLy8gbWFrZSB0aGUgY2x1c3RlcnMNCiAgICBmdW5jdGlvbiBtYWtlQ2x1c3RlcnMoc2NhbGUpIHsNCiAgICAgICAgY3RybHdhaXQgPSAxOw0KICAgICAgICB2YXIgY2x1c3Rlck9wdGlvbnNCeURhdGEgPSB7DQogICAgICAgICAgICBwcm9jZXNzUHJvcGVydGllczogZnVuY3Rpb24gKGNsdXN0ZXJPcHRpb25zLCBjaGlsZE5vZGVzKSB7DQogICAgICAgICAgICAgICAgY2x1c3RlckluZGV4ID0gY2x1c3RlckluZGV4ICsgMTsNCiAgICAgICAgICAgICAgICB2YXIgY2hpbGRyZW5Db3VudCA9IDA7DQogICAgICAgICAgICAgICAgdmFyIGNsdXN0ZXJfbGV2ZWwgPSA5OTk5OTk5Ow0KICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgY2hpbGROb2Rlcy5sZW5ndGg7IGkrKykgew0KICAgICAgICAgICAgICAgICAgICBjaGlsZHJlbkNvdW50ICs9IGNoaWxkTm9kZXNbaV0uY2hpbGRyZW5Db3VudCB8fCAxOw0KICAgICAgICAgICAgICAgICAgICBpZihjaGlsZE5vZGVzW2ldLmxldmVsKXsNCiAgICAgICAgICAgICAgICAgICAgICBjbHVzdGVyX2xldmVsID0gTWF0aC5taW4oY2x1c3Rlcl9sZXZlbCwgY2hpbGROb2Rlc1tpXS5sZXZlbCkNCiAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBjbHVzdGVyT3B0aW9ucy5jaGlsZHJlbkNvdW50ID0gY2hpbGRyZW5Db3VudDsNCiAgICAgICAgICAgICAgICBjbHVzdGVyT3B0aW9ucy5sYWJlbCA9ICIjICIgKyBjaGlsZHJlbkNvdW50ICsgIiI7DQogICAgICAgICAgICAgICAgY2x1c3Rlck9wdGlvbnMuZm9udCA9IHtzaXplOiBjaGlsZHJlbkNvdW50KjUrMzB9DQogICAgICAgICAgICAgICAgY2x1c3Rlck9wdGlvbnMuaWQgPSAnY2x1c3RlcjonICsgY2x1c3RlckluZGV4Ow0KICAgICAgICAgICAgICAgIGNsdXN0ZXJzLnB1c2goe2lkOidjbHVzdGVyOicgKyBjbHVzdGVySW5kZXgsIHNjYWxlOnNjYWxlfSk7DQogICAgICAgICAgICAgICAgDQogICAgICAgICAgICAgICAgaWYoY2x1c3Rlcl9sZXZlbCAhPT0gOTk5OTk5OSl7DQogICAgICAgICAgICAgICAgICBjbHVzdGVyT3B0aW9ucy5sZXZlbCA9IGNsdXN0ZXJfbGV2ZWwNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgcmV0dXJuIGNsdXN0ZXJPcHRpb25zOw0KICAgICAgICAgICAgfSwNCiAgICAgICAgICAgIGNsdXN0ZXJOb2RlUHJvcGVydGllczoge2JvcmRlcldpZHRoO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ICAgIGlmKHguaWNvbnNSZWRyYXcgIT09IHVuZGVmaW5lZCl7DQogICAgICBpZih4Lmljb25zUmVkcmF3KXsNCiAgICAgICAgaWNvbnNSZWRyYXcoKTsNCiAgICAgICAgaW5zdGFuY2UubmV0d29yay5vbmNlKCJzdGFiaWxpemVkIiwgZnVuY3Rpb24oKXtpY29uc1JlZHJhdygpO30pDQogICAgICB9DQogICAgfQ0KICB9LCANCiAgDQogIHJlc2l6ZTogZnVuY3Rpb24oZWwsIHdpZHRoLCBoZWlnaHQsIGluc3RhbmNlKSB7DQogICAgICBpZihpbnN0YW5jZS5uZXR3b3JrKQ0KICAgICAgICBpbnN0YW5jZS5uZXR3b3JrLmZpdCgpOw0KICAgICAgaWYoaW5zdGFuY2UubGVnZW5kKQ0KICAgICAgICBpbnN0YW5jZS5sZWdlbmQuZml0KCk7DQogIH0NCiAgDQp9KTsNCg=="></script>
<script src="data:application/x-javascript;base64,LyohIEBzb3VyY2UgaHR0cDovL3B1cmwuZWxpZ3JleS5jb20vZ2l0aHViL0ZpbGVTYXZlci5qcy9ibG9iL21hc3Rlci9GaWxlU2F2ZXIuanMgKi8NCnZhciBzYXZlQXM9c2F2ZUFzfHxmdW5jdGlvbih2aWV3KXsidXNlIHN0cmljdCI7aWYodHlwZW9mIG5hdmlnYXRvciE9PSJ1bmRlZmluZWQiJiYvTVNJRSBbMS05XVwuLy50ZXN0KG5hdmlnYXRvci51c2VyQWdlbnQpKXtyZXR1cm59dmFyIGRvYz12aWV3LmRvY3VtZW50LGdldF9VUkw9ZnVuY3Rpb24oKXtyZXR1cm4gdmlldy5VUkx8fHZpZXcud2Via2l0VVJMfHx2aWV3fSxzYXZlX2xpbms9ZG9jLmNyZWF0ZUVsZW1lbnROUygiaHR0cDovL3d3dy53My5vcmcvMTk5OS94aHRtbCIsImEiKSxjYW5fdXNlX3NhdmVfbGluaz0iZG93bmxvYWQiaW4gc2F2ZV9saW5rLGNsaWNrPWZ1bmN0aW9uKG5vZGUpe3Z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xzdHlsZT4gc2hlZXRzIHdoZW4gZmV0Y2hlZCB0aHJvdWdoIGdldENvbXB1dGVkU3R5bGUNCiAgICAgICAgIGlmIHdpbmRvdyB1cmwgaXMgYWJvdXQ6YmxhbmssIHdlIGNhbiBhc3NpZ24gdGhlIHVybCB0byBjdXJyZW50IGJ5IHdyaXRpbmcgb250byB0aGUgZG9jdW1lbnQNCiAgICAgICAgICovDQogICAgICAgIGNvbnRhaW5lci5jb250ZW50V2luZG93Lm9ubG9hZCA9IGNvbnRhaW5lci5vbmxvYWQgPSBmdW5jdGlvbigpIHsNCiAgICAgICAgICAgIHZhciBpbnRlcnZhbCA9IHNldEludGVydmFsKGZ1bmN0aW9uKCkgew0KICAgICAgICAgICAgICAgIGlmIChkb2N1bWVudENsb25lLmJvZHkuY2hpbGROb2Rlcy5sZW5ndGggPiAwKSB7DQogICAgICAgICAgICAgICAgICAgIGNsb25lQ2FudmFzQ29udGVudHMob3duZXJEb2N1bWVudCwgZG9jdW1lbnRDbG9uZSk7DQogICAgICAgICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwoaW50ZXJ2YWwpOw0KICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy50eXBlID09PSAidmlldyIpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRhaW5lci5jb250ZW50V2luZG93LnNjcm9sbFRvKHgsIHkpOw0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgIHJlc29sdmUoY29udGFpbmVyKTsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICB9LCA1MCk7DQogICAgICAgIH07DQoNCiAgICAgICAgZG9jdW1lbnRDbG9uZS5vcGVuKCk7DQogICAgICAgIGRvY3VtZW50Q2xvbmUud3JpdGUoIjwhRE9DVFlQRSBodG1sPjxodG1sPjwvaHRtbD4iKTsNCiAgICAgICAgLy8gQ2hyb21lIHNjcm9sbHMgdGhlIHBhcmVudCBkb2N1bWVudCBmb3Igc29tZSByZW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F0aGlzLmltYWdlKSB7DQogICAgICAgIGxvZygiSW5pdGlhdGluZyBEdW1teUltYWdlQ29udGFpbmVyIik7DQogICAgICAgIER1bW15SW1hZ2VDb250YWluZXIucHJvdG90eXBlLmltYWdlID0gbmV3IEltYWdlKCk7DQogICAgICAgIHZhciBpbWFnZSA9IHRoaXMuaW1hZ2U7DQogICAgICAgIER1bW15SW1hZ2VDb250YWluZXIucHJvdG90eXBlLnByb21pc2UgPSBuZXcgUHJvbWlzZShmdW5jdGlvbihyZXNvbHZlLCByZWplY3QpIHsNCiAgICAgICAgICAgIGltYWdlLm9ubG9hZCA9IHJlc29sdmU7DQogICAgICAgICAgICBpbWFnZS5vbmVycm9yID0gcmVqZWN0Ow0KICAgICAgICAgICAgaW1hZ2Uuc3JjID0gc21hbGxJbWFnZSgpOw0KICAgICAgICAgICAgaWYgKGltYWdlLmNvbXBsZXRlID09PSB0cnVlKSB7DQogICAgICAgICAgICAgICAgcmVzb2x2ZShpbWFnZSk7DQogICAgICAgICAgICB9DQogICAgICAgIH0pOw0KICAgIH0NCn0NCg0KZnVuY3Rpb24gRm9udChmYW1pbHksIHNpemUpIHsNCiAgICB2YXIgY29udGFpbmVyID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnZGl2JyksDQogICAgICAgIGltZyA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2ltZycpLA0KICAgICAgICBzcGFuID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnc3BhbicpLA0KICAgICAgICBzYW1wbGVUZXh0ID0gJ0hpZGRlbiBUZXh0JywNCiAgICAgICAgYmFzZWxpbmUsDQogICAgICAgIG1pZGRsZTsNCg0KICAgIGNvbnRhaW5lci5zdHlsZS52aXNpYmlsaXR5ID0gImhpZGRlbiI7DQogICAgY29udGFpbmVyLnN0eWxlLmZvbnRGYW1pbHkgPSBmYW1pbHk7DQogICAgY29udGFpbmVyLnN0eWxlLmZvbnRTaXplID0gc2l6ZTsNCiAgICBjb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ZShzZWxmLmltYWdlKTsNCiAgICAgICAgfQ0KICAgIH0pOw0KfQ0KDQpmdW5jdGlvbiBJbWFnZUxvYWRlcihvcHRpb25zLCBzdXBwb3J0KSB7DQogICAgdGhpcy5saW5rID0gbnVsbDsNCiAgICB0aGlzLm9wdGlvbnMgPSBvcHRpb25zOw0KICAgIHRoaXMuc3VwcG9ydCA9IHN1cHBvcnQ7DQogICAgdGhpcy5vcmlnaW4gPSB0aGlzLmdldE9yaWdpbih3aW5kb3cubG9jYXRpb24uaHJlZik7DQp9DQoNCkltYWdlTG9hZGVyLnByb3RvdHlwZS5maW5kSW1hZ2VzID0gZnVuY3Rpb24obm9kZXMpIHsNCiAgICB2YXIgaW1hZ2VzID0gW107DQogICAgbm9kZXMucmVkdWNlKGZ1bmN0aW9uKGltYWdlTm9kZXMsIGNvbnRhaW5lcikgew0KICAgICAgICBzd2l0Y2goY29udGFpbmVyLm5vZGUubm9kZU5hbWUpIHsNCiAgICAgICAgY2FzZSAiSU1HIjoNCiAgICAgICAgICAgIHJldHVybiBpbWFnZU5vZGVzLmNvbmNhdChbew0KICAgICAgICAgICAgICAgIGFyZ3M6IFtjb250YWluZXIubm9kZS5zcmNdLA0KICAgICAgICAgICAgICAgIG1ldGhvZDogInVybCINCiAgICAgICAgICAgIH1dKTsNCiAgICAgICAgY2FzZSAic3ZnIjoNCiAgICAgICAgY2FzZSAiSUZSQU1FIjoNCiAgICAgICAgICAgIHJldHVybiBpbWFnZU5vZGVzLmNvbmNhdChbew0KICAgICAgICAgICAgICAgIGFyZ3M6IFtjb250YWluZXIubm9kZV0sDQogICAgICAgICAgICAgICAgbWV0aG9kOiBjb250YWluZXIubm9kZS5ub2RlTmFtZQ0KICAgICAgICAgICAgfV0pOw0KICAgICAgICB9DQogICAgICAgIHJldHVybiBpbWFnZU5vZGVzOw0KICAgIH0sIFtdKS5mb3JFYWNoKHRoaXMuYWRkSW1hZ2UoaW1hZ2VzLCB0aGlzLmxvYWRJbWFnZSksIHRo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0aGlzLngxID0gMTsNCiAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgIGNhc2UgInRvcCI6DQogICAgICAgICAgICAgICAgdGhpcy55MCA9IDA7DQogICAgICAgICAgICAgICAgdGhpcy55MSA9IDE7DQogICAgICAgICAgICAgICAgYnJlYWs7DQogICAgICAgICAgICBjYXNlICJyaWdodCI6DQogICAgICAgICAgICAgICAgdGhpcy54MCA9IDE7DQogICAgICAgICAgICAgICAgdGhpcy54MSA9IDA7DQogICAgICAgICAgICAgICAgYnJlYWs7DQogICAgICAgICAgICBjYXNlICJib3R0b20iOg0KICAgICAgICAgICAgICAgIHRoaXMueTAgPSAxOw0KICAgICAgICAgICAgICAgIHRoaXMueTEgPSAwOw0KICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgICAgY2FzZSAidG8iOg0KICAgICAgICAgICAgICAgIHZhciB5MCA9IHRoaXMueTA7DQogICAgICAgICAgICAgICAgdmFyIHgwID0gdGhpcy54MDsNCiAgICAgICAgICAgICAgICB0aGlzLnkwID0gdGhpcy55MTsNCiAgICAgICAgICAgICAgICB0aGlzLngwID0gdGhpcy54MTsNCiAgICAgICAgICAgICAgICB0aGlzLngxID0geDA7DQogICAgICAgICAgICAgICAgdGhpcy55MSA9IHkwOw0KICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9LCB0aGlzKTsNCiAgICB9IGVsc2Ugew0KICAgICAgICB0aGlzLnkwID0gMDsNCiAgICAgICAgdGhpcy55MSA9IDE7DQogICAgfQ0KDQogICAgdGhpcy5jb2xvclN0b3BzID0gaW1hZ2VEYXRhLmFyZ3Muc2xpY2UoaGFzRGlyZWN0aW9uID8gMSA6IDApLm1hcChmdW5jdGlvbihjb2xvclN0b3ApIHsNCiAgICAgICAgdmFyIGNvbG9yU3RvcE1hdGNoID0gY29sb3JTdG9wLm1hdGNoKHRoaXMuc3RlcFJlZ0V4cCk7DQogICAgICAgIHJldHVybiB7D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+IDApIHsNCiAgICAgICAgICAgICAgICBwcmVmaXggPSBtZXRob2Quc3Vic3RyKDAsIHByZWZpeF9pKTsNCiAgICAgICAgICAgICAgICBtZXRob2QgPSBtZXRob2Quc3Vic3RyKHByZWZpeF9pKTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgICAgIHJlc3VsdHMucHVzaCh7DQogICAgICAgICAgICAgICAgcHJlZml4OiBwcmVmaXgsDQogICAgICAgICAgICAgICAgbWV0aG9kOiBtZXRob2QudG9Mb3dlckNhc2UoKSwNCiAgICAgICAgICAgICAgICB2YWx1ZTogYmxvY2ssDQogICAgICAgICAgICAgICAgYXJnczogYXJncywNCiAgICAgICAgICAgICAgICBpbWFnZTogbnVsbA0KICAgICAgICAgICAgfSk7DQogICAgICAgIH0NCiAgICAgICAgYXJncyA9IFtdOw0KICAgICAgICBtZXRob2QgPSBwcmVmaXggPSBkZWZpbml0aW9uID0gYmxvY2sgPSAnJzsNCiAgICB9Ow0KICAgIGFyZ3MgPSBbXTsNCiAgICBtZXRob2QgPSBwcmVmaXggPSBkZWZpbml0aW9uID0gYmxvY2sgPSAnJzsNCiAgICBiYWNrZ3JvdW5kSW1hZ2Uuc3BsaXQoIiIpLmZvckVhY2goZnVuY3Rpb24oYykgew0KICAgICAgICBpZiAobW9kZSA9PT0gMCAmJiB3aGl0ZXNwYWNlLmluZGV4T2YoYykgPiAtMSkgew0KICAgICAgICAgICAgcmV0dXJuOw0KICAgICAgICB9DQogICAgICAgIHN3aXRjaChjKSB7DQogICAgICAgIGNhc2UgJyInOg0KICAgICAgICAgICAgaWYoIXF1b3RlKSB7DQogICAgICAgICAgICAgICAgcXVvdGUgPSBjOw0KICAgICAgICAgICAgfSBlbHNlIGlmKHF1b3RlID09PSBjKSB7DQogICAgICAgICAgICAgICAgcXVvdGUgPSBudWxsOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgYnJlYWs7DQogICAgICAgIGNhc2UgJygnOg0KICAgICAgICAgICAgaWYocXVvdGUpIHsNCiAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgIH0gZWxzZSBpZihtb2RlID09PSAwKSB7DQogICAgICAgICAgICAgICAgbW9kZSA9IDE7DQogICAgICAgICAgICAgICAgYmxvY2sgKz0gYzsNCiAgICAgICAgICAgICAgICByZXR1cm47DQogICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICAgIG51bVBhcmVuKys7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBicmVhazsNCiAgICAgICAgY2FzZSAnKSc6DQogICAgICAgICAgICBpZiAocXVvdGUpIHsNCiAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgIH0gZWxzZSBpZihtb2RlID09PSAxKSB7DQogICAgICAgICAgICAgICAgaWYobnVtUGFyZW4gPT09IDApIHsNCiAgICAgICAgICAgICAgICAgICAgbW9kZSA9IDA7DQogICAgICAgICAgICAgICAgICAgIGJsb2NrICs9IGM7DQogICAgICAgICAgICAgICAgICAgIGFwcGVuZFJlc3VsdCgpOw0KICAgICAgICAgICAgICAgICAgICByZXR1cm47DQogICAgICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgICAgICAgbnVtUGFyZW4tLTsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICB9DQogICAgICAgICAgICBicmVhazsNCg0KICAgICAgICBjYXNlICcsJzoNCiAgICAgICAgICAgIGlmIChxdW90ZSkgew0KICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgICAgfSBlbHNlIGlmKG1vZGUgPT09IDApIHsNCiAgICAgICAgICAgICAgICBhcHBlbmRSZXN1bHQoKTsNCiAgICAgICAgICAgICAgICByZXR1cm47DQogICAgICAgICAgICB9IGVsc2UgaWYgKG1vZGUgPT09IDEpIHsNCiAgICAgICAgICAgICAgICBpZiAobnVtUGFyZW4gPT09IDAgJiYgIW1ldGhvZC5tYXRjaCgvXnVybCQvaSkpIHsNCiAgICAgICAgICAgICAgICAgICAgYXJncy5wdXNoKGRlZmluaXRpb24pOw0KICAgICAgICAgICAgICAgICAgICBkZWZpbml0aW9uID0gJyc7DQogICAgICAgICAgICAgICAgICAgIGJsb2NrICs9IGM7DQogICAgICAgICAgICAgICAgICAgIHJldHVybjsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICB9DQogICAgICAgICAgICBicmVhazsNCiAgICAgICAgfQ0KDQogICAgICAgIGJsb2NrICs9IGM7DQogICAgICAgIGlmIChtb2RlID09PSAwKSB7DQogICAgICAgICAgICBtZXRob2QgKz0gYzsNCiAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgIGRlZmluaXRpb24gKz0gYzsNCiAgICAgICAgfQ0KICAgIH0pOw0KDQogICAgYXBwZW5kUmVzdWx0KCk7DQogICAgcmV0dXJuIHJlc3VsdHM7DQp9DQoNCmZ1bmN0aW9uIHJlbW92ZVB4KHN0cikgew0KICAgIHJldHVybiBzdHIucmVwbGFjZSgicHgiLCAiIik7DQp9DQoNCmZ1bmN0aW9uIGFzRmxvYXQoc3RyKSB7DQogICAgcmV0dXJuIHBhcnNlRmxvYXQoc3RyKTsNCn0NCg0KZnVuY3Rpb24gZ2V0Qm91bmRzKG5vZGUpIHsNCiAgICBpZiAobm9kZS5nZXRCb3VuZGluZ0NsaWVudFJlY3QpIHsNCiAgICAgICAgdmFyIGNsaWVudFJlY3QgPSBub2RlLmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpOw0KICAgICAgICB2YXIgd2lkdGggPSBub2RlLm9mZnNldFdpZHRoID09IG51bGwgPyBjbGllbnRSZWN0LndpZHRoIDogbm9kZS5vZmZzZXRXaWR0aDsNCiAgICAgICAgcmV0dXJuIHsNCiAgICAgICAgICAgIHRvcDogY2xpZW50UmVjdC50b3AsDQogICAgICAgICAgICBib3R0b206IGNsaWVudFJlY3QuYm90dG9tIHx8IChjbGllbnRSZWN0LnRvcCArIGNsaWVudFJlY3QuaGVpZ2h0KSwNCiAgICAgICAgICAgIHJpZ2h0OiBjbG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lcikgew0KICAgICAgICBpZiAoaXNFbGVtZW50KGNvbnRhaW5lcikpIHsNCiAgICAgICAgICAgIGlmIChpc1BzZXVkb0VsZW1lbnQoY29udGFpbmVyKSkgew0KICAgICAgICAgICAgICAgIGNvbnRhaW5lci5hcHBlbmRUb0RPTSgpOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgY29udGFpbmVyLmJvcmRlcnMgPSB0aGlzLnBhcnNlQm9yZGVycyhjb250YWluZXIpOw0KICAgICAgICAgICAgdmFyIGNsaXAgPSAoY29udGFpbmVyLmNzcygnb3ZlcmZsb3cnKSA9PT0gImhpZGRlbiIpID8gW2NvbnRhaW5lci5ib3JkZXJzLmNsaXBdIDogW107DQogICAgICAgICAgICB2YXIgY3NzQ2xpcCA9IGNvbnRhaW5lci5wYXJzZUNsaXAoKTsNCiAgICAgICAgICAgIGlmIChjc3NDbGlwICYmIFsiYWJzb2x1dGUiLCAiZml4ZWQiXS5pbmRleE9mKGNvbnRhaW5lci5jc3MoJ3Bvc2l0aW9uJykpICE9PSAtMSkgew0KICAgICAgICAgICAgICAgIGNsaXAucHVzaChbWyJyZWN0IiwNCiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRhaW5lci5ib3VuZHMubGVmdCArIGNzc0NsaXAubGVmdCwNCiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRhaW5lci5ib3VuZHMudG9wICsgY3NzQ2xpcC50b3AsDQogICAgICAgICAgICAgICAgICAgICAgICBjc3NDbGlwLnJpZ2h0IC0gY3NzQ2xpcC5sZWZ0LA0KICAgICAgICAgICAgICAgICAgICAgICAgY3NzQ2xpcC5ib3R0b20gLSBjc3NDbGlwLnRvcA0KICAgICAgICAgICAgICAgIF1dKTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgICAgIGNvbnRhaW5lci5jbGlwID0gaGFzUGFyZW50Q2xpcChjb250YWluZXIpID8gY29udGFpbmVyLnBhcmVudC5jbGlwLmNvbmNhdChjbGlwKSA6IGNsaXA7DQogICAgICAgICAgICBjb250YWluZXIuYmFja2dyb3VuZENsaXAgPSAoY29udGFpbmVyLmNzcygnb3ZlcmZsb3cnKSAhPT0gImhpZGRlbiIpID8gY29udGFpbmVyLmNsaXAuY29uY2F0KFtjb250YWluZXIuYm9yZGVycy5jbGlwXSkgOiBjb250YWluZXIuY2xpcDsNCiAgICAgICAgICAgIGlmIChpc1BzZXVkb0VsZW1lbnQoY29udGFpbmVyKSkgew0KICAgICAgICAgICAgICAgIGNvbnRhaW5lci5jbGVhbkRPTSgpOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9IGVsc2UgaWYgKGlzVGV4dE5vZGUoY29udGFpbmVyKSkgew0KICAgICAgICAgICAgY29udGFpbmVyLmNsaXAgPSBoYXNQYXJlbnRDbGlwKGNvbnRhaW5lcikgPyBjb250YWluZXIucGFyZW50LmNsaXAgOiBbXTsNCiAgICAgICAgfQ0KICAgICAgICBpZiAoIWlzUHNldWRvRWxlbWVudChjb250YWluZXIpKSB7DQogICAgICAgICAgICBjb250YWluZXIuYm91bmRzID0gbnVsbDsNCiAgICAgICAgfQ0KICAgIH0sIHRoaXMpOw0KfTsNCg0KZnVuY3Rpb24gaGFzUGFyZW50Q2xpcChjb250YWluZXIpIHsNCiAgICByZXR1cm4gY29udGFpbmVyLnBhcmVudCAmJiBjb250YWluZXIucGFyZW50LmNsaXAubGVuZ3RoOw0KfQ0KDQpOb2RlUGFyc2VyLnByb3RvdHlwZS5hc3luY1JlbmRlcmVyID0gZnVuY3Rpb24ocXVldWUsIHJlc29sdmUsIGFzeW5jVGltZXIpIHsNCiAgICBhc3luY1RpbWVyID0gYXN5bmNUaW1lciB8fCBEYXRlLm5vdygpOw0KICAgIHRoaXMucGFpbnQocXVldWVbdGhpcy5yZW5kZXJJbmRleCsrXSk7DQogICAgaWYgKHF1ZXVlLmxlbmd0aCA9PT0gdGhpcy5yZW5kZXJJbmRleCkgew0KICAgICAgICByZXNvbHZlKCk7DQogICAgfSBlbHNlIGlmIChh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5ldyBOb2RlQ29udGFpbmVyKG5vZGUsIHBhcmVudENvbnRhaW5lcildLmZpbHRlcihub25JZ25vcmVkRWxlbWVudCk7DQogICAgICAgIHJldHVybiBub2RlLm5vZGVUeXBlID09PSBOb2RlLkVMRU1FTlRfTk9ERSAmJiBjb250YWluZXIubGVuZ3RoICYmIG5vZGUudGFnTmFtZSAhPT0gIlRFWFRBUkVBIiA/IChjb250YWluZXJbMF0uaXNFbGVtZW50VmlzaWJsZSgpID8gY29udGFpbmVyLmNvbmNhdCh0aGlzLmdldENoaWxkcmVuKGNvbnRhaW5lclswXSkpIDogW10pIDogY29udGFpbmVyOw0KICAgIH0sIHRoaXMpKTsNCn07DQoNCk5vZGVQYXJzZXIucHJvdG90eXBlLm5ld1N0YWNraW5nQ29udGV4dCA9IGZ1bmN0aW9uKGNvbnRhaW5lciwgaGFzT3duU3RhY2tpbmcpIHsNCiAgICB2YXIgc3RhY2sgPSBuZXcgU3RhY2tpbmdDb250ZXh0KGhhc093blN0YWNraW5nLCBjb250YWluZXIuZ2V0T3BhY2l0eSgpLCBjb250YWluZXIubm9kZSwgY29udGFpbmVyLnBhcmVudCk7DQogICAgY29udGFpbmVyLmNsb25lVG8oc3RhY2spOw0KICAgIHZhciBwYXJlbnRTdGFjayA9IGhhc093blN0YWNraW5nID8gc3RhY2suZ2V0UGFyZW50U3RhY2sodGhpcykgOiBzdGFjay5wYXJlbnQuc3RhY2s7DQogICAgcGFyZW50U3RhY2suY29udGV4dHMucHVzaChzdGFjayk7DQogICAgY29udGFpbmVyLnN0YWNrID0gc3RhY2s7DQp9Ow0KDQpOb2RlUGFyc2VyLnByb3RvdHlwZS5jcmVhdGVTdGFja2luZ0NvbnRleHRzID0gZnVuY3Rpb24oKSB7DQogICAgdGhpcy5ub2Rlcy5mb3JFYWNoKGZ1bmN0aW9uKGNvbnRhaW5lcikgew0KICAgICAgICBpZiAoaXNFbGVtZW50KGNvbnRhaW5lcikgJiYgKHRoaXMuaXNSb290RWxlbWV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hdGl2ZVppbmRleC5jb25jYXQobm9uSW5saW5lTm9uUG9zaXRpb25lZERlc2NlbmRhbnRzKS5jb25jYXQobm9uUG9zaXRpb25lZEZsb2F0cykNCiAgICAgICAgLmNvbmNhdChpbkZsb3cpLmNvbmNhdChzdGFja0xldmVsMCkuY29uY2F0KHRleHQpLmNvbmNhdChwb3NpdGl2ZVppbmRleCkuZm9yRWFjaChmdW5jdGlvbihjb250YWluZXIpIHsNCiAgICAgICAgICAgIHRoaXMucmVuZGVyUXVldWUucHVzaChjb250YWluZXIpOw0KICAgICAgICAgICAgaWYgKGlzU3RhY2tpbmdDb250ZXh0KGNvbnRhaW5lcikpIHsNCiAgICAgICAgICAgICAgICB0aGlzLnBhcnNlKGNvbnRhaW5lcik7DQogICAgICAgICAgICAgICAgdGhpcy5yZW5kZXJRdWV1ZS5wdXNoKG5ldyBDbGVhclRyYW5zZm9ybSgpKTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSwgdGhpcyk7DQp9Ow0KDQpOb2RlUGFyc2VyLnByb3RvdHlwZS5wYWludCA9IGZ1bmN0aW9uKGNvbnRhaW5lcikgew0KICAgIHRyeSB7DQogICAgICAgIGlmIChjb250YWluZXIgaW5zdGFuY2VvZiBDbGVhclRyYW5zZm9ybSkgew0KICAgICAgICAgICAgdGhpcy5yZW5kZXJlci5jdHgucmVzdG9yZSgpOw0KICAgICAgICB9IGVsc2UgaWYgKGlzVGV4dE5vZGUoY29udGFpbmVyKSkgew0KICAgICAgICAgICAgaWYgKGlzUHNldWRvRWxlbWVudChjb250YWluZXIucGFyZW50KSkgew0KICAgICAgICAgICAgICAgIGNvbnRhaW5lci5wYXJlbnQuYXBwZW5kVG9ET00oKTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgICAgIHRoaXMucGFpbnRUZXh0KGNvbnRhaW5lcik7DQogICAgICAgICAgICBpZiAoaXNQc2V1ZG9FbGVtZW50KGNvbnRhaW5lci5wYXJlbnQpKSB7DQogICAgICAgICAgICAgICAgY29udGFpbmVyLnBhcmVudC5jbGVhbkRPTSgpOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgdGhpcy5wYWludE5vZGUoY29udGFpbmVyKTsNCiAgICAgICAgfQ0KICAgIH0gY2F0Y2goZSkgew0KICAgICAgICBsb2coZSk7DQogICAgICAgIGlmICh0aGlzLm9wdGlvbnMuc3RyaWN0KSB7DQogICAgICAgICAgICB0aHJvdyBlOw0KICAgICAgICB9DQogICAgfQ0KfTsNCg0KTm9kZVBhcnNlci5wcm90b3R5cGUucGFpbnROb2RlID0gZnVuY3Rpb24oY29udGFpbmVyKSB7DQogICAgaWYgKGlzU3RhY2tpbmdDb250ZXh0KGNvbnRhaW5lcikpIHsNCiAgICAgICAgdGhpcy5yZW5kZXJlci5zZXRPcGFjaXR5KGNvbnRhaW5lci5vcGFjaXR5KTsNCiAgICAgICAgdGhpcy5yZW5kZXJlci5jdHguc2F2ZSgpOw0KICAgICAgICBpZiAoY29udGFpbmVyLmhhc1RyYW5zZm9ybSgpKSB7DQogICAgICAgICAgICB0aGlzLnJlbmRlcmVyLnNldFRyYW5zZm9ybShjb250YWluZXIucGFyc2VUcmFuc2Zvcm0oKSk7DQogICAgICAgIH0NCiAgICB9DQoNCiAgICBpZiAoY29udGFpbmVyLm5vZGUubm9kZU5hbWUgPT09ICJJTlBVVCIgJiYgY29udGFpbmVyLm5vZGUudHlwZSA9PT0gImNoZWNrYm94Iikgew0KICAgICAgICB0aGlzLnBhaW50Q2hlY2tib3goY29udGFpbmVyKTsNCiAgICB9IGVsc2UgaWYgKGNvbnRhaW5lci5ub2RlLm5vZGVOYW1lID09PSAiSU5QVVQiICYmIGNvbnRhaW5lci5ub2RlLnR5cGUgPT09ICJyYWRpbyIpIHsNCiAgICAgICAgdGhpcy5wYWludFJhZGlvKGNvbnRhaW5lcik7DQogICAgfSBlbHNlIHsNCiAgICAgICAgdGhpcy5wYWludEVsZW1lbnQoY29udGFpbmVyKTsNCiAgICB9DQp9Ow0KDQpOb2RlUGFyc2VyLnByb3RvdHlwZS5wYWludEVsZW1lbnQgPSBmdW5jdGlvbihjb250YWluZXIpIHsNCiAgICB2YXIgYm91bmRzID0gY29udGFpbmVyLnBhcnNlQm91bmRzKCk7DQogICAgdGhpcy5yZW5kZXJlci5jbGlwKGNvbnRhaW5lci5iYWNrZ3JvdW5kQ2xpcCwgZnVuY3Rpb24oKSB7DQogICAgICAgIHRoaXMucmVuZGVyZXIucmVuZGVyQmFja2dyb3VuZChjb250YWluZXIsIGJvdW5kcywgY29udGFpbmVyLmJvcmRlcnMuYm9yZGVycy5tYXAoZ2V0V2lkdGgpKTsNCiAgICB9LCB0aGlzKTsNCg0KICAgIHRoaXMucmVuZGVyZXIuY2xpcChjb250YWluZXIuY2xpcCwgZnVuY3Rpb24oKSB7DQogICAgICAgIHRoaXMucmVuZGVyZXIucmVuZGVyQm9yZGVycyhjb250YWluZXIuYm9yZGVycy5ib3JkZXJzKTsNCiAgICB9LCB0aGlzKTsNCg0KICAgIHRoaXMucmVuZGVyZXIuY2xpcChjb250YWluZXIuYmFja2dyb3VuZENsaXAsIGZ1bmN0aW9uKCkgew0KICAgICAgICBzd2l0Y2ggKGNvbnRhaW5lci5ub2RlLm5vZGVOYW1lKSB7DQogICAgICAgIGNhc2UgInN2ZyI6DQogICAgICAgIGNhc2UgIklGUkFNRSI6DQogICAgICAgICAgICB2YXIgaW1nQ29udGFpbmVyID0gdGhpcy5pbWFnZXMuZ2V0KGNvbnRhaW5lci5ub2RlKTsNCiAgICAgICAgICAgIGlmIChpbWdDb250YWluZXIpIHsNCiAgICAgICAgICAgICAgICB0aGlzLnJlbmRlcmVyLnJlbmRlckltYWdlKGNvbnRhaW5lciwgYm91bmRzLCBjb250YWluZXIuYm9yZGVycywgaW1nQ29udGFpbmVyKTsNCiAgICAgICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICAgICAgbG9nKCJFcnJvciBsb2FkaW5nIDwiICsgY29udGFpbmVyLm5vZGUubm9kZU5hbWUgKyAiPiIsIGNvbnRhaW5lci5ub2RlKTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICBjYXNlICJJTUciOg0KICAgICAgICAgICAgdmFyIGltYWdlQ29udGFpbmVyID0gdGhpcy5pbWFnZXMuZ2V0KGNvbnRhaW5lci5ub2RlLnNyYyk7DQogICAgICAgICAgICBpZiAoaW1hZ2VDb250YWluZXIpIHsNCiAgICAgICAgICAgICAgICB0aGlzLnJlbmRlcmVyLnJlbmRlckltYWdlKGNvbnRhaW5lciwgYm91bmRzLCBjb250YWluZXIuYm9yZGVycywgaW1hZ2VDb250YWluZXIpOw0KICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgICBsb2coIkVycm9yIGxvYWRpbmcgPGltZz4iLCBjb250YWluZXIubm9kZS5zcmMpOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgYnJlYWs7DQogICAgICAgIGNhc2UgIkNBTlZBUyI6DQogICAgICAgICAgICB0aGlzLnJlbmRlcmVyLnJlbmRlckltYWdlKGNvbnRhaW5lciwgYm91bmRzLCBjb250YWluZXIuYm9yZGVycywge2ltYWdlOiBjb250YWluZXIubm9kZX0pOw0KICAgICAgICAgICAgYnJlYWs7DQogICAgICAgIGNhc2UgIlNFTEVDVCI6DQogICAgICAgIGNhc2UgIklOUFVUIjoNCiAgICAgICAgY2FzZSAiVEVYVEFSRUEiOg0KICAgICAgICAgICAgdGhpcy5wYWludEZvcm1WYWx1ZShjb250YWluZXIpOw0KICAgICAgICAgICAgYnJlYWs7DQogICAgICAgIH0NCiAgICB9LCB0aGlzKTsNCn07DQoNCk5vZGVQYXJzZXIucHJvdG90eXBlLnBhaW50Q2hlY2tib3ggPSBmdW5jdGlvbihjb250YWluZXIpIHsNCiAgICB2YXIgYiA9IGNvbnRhaW5lci5wYXJzZUJvdW5kcygpOw0KDQogICAgdmFyIHNpemUgPSBNYXRoLm1pbihiL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HdyYXBwZXIgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdodG1sMmNhbnZhc3dyYXBwZXInKTsNCiAgICAgICAgdmFyIHByb3BlcnRpZXMgPSBbJ2xpbmVIZWlnaHQnLCAndGV4dEFsaWduJywgJ2ZvbnRGYW1pbHknLCAnZm9udFdlaWdodCcsICdmb250U2l6ZScsICdjb2xvcicsDQogICAgICAgICAgICAncGFkZGluZ0xlZnQnLCAncGFkZGluZ1RvcCcsICdwYWRkaW5nUmlnaHQnLCAncGFkZGluZ0JvdHRvbScsDQogICAgICAgICAgICAnd2lkdGgnLCAnaGVpZ2h0JywgJ2JvcmRlckxlZnRTdHlsZScsICdib3JkZXJUb3BTdHlsZScsICdib3JkZXJMZWZ0V2lkdGgnLCAnYm9yZGVyVG9wV2lkdGgnLA0KICAgICAgICAgICAgJ2JveFNpemluZycsICd3aGl0ZVNwYWNlJywgJ3dvcmRXcmFwJ107DQoNCiAgICAgICAgcHJvcGVydGllcy5mb3JFYWNoKGZ1bmN0aW9uKHByb3BlcnR5KSB7DQogICAgICAgICAgICB0cnkgew0KICAgICAgICAgICAgICAgIHdyYXBwZXIuc3R5bGVbcHJvcGVydHldID0gY29udGFpbmVyLmNzcyhwcm9wZXJ0eSk7DQogICAgICAgICAgICB9IGNhdGNoKGUpIHsNCiAgICAgICAgICAgICAgICAvLyBPbGRlciBJRSBoYXMgaXNzdWVzIHdpdGggImJvcmRlciINCiAgICAgICAgICAgICAgICBsb2coImh0bWwyY2FudmFzOiBQYXJzZTogRXhjZXB0aW9uIGNhdWdodCBpbiByZW5kZXJGb3JtVmFsdWU6ICIgKyBlLm1lc3NhZ2UpOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICAgICAgdmFyIGJvdW5kcyA9IGNvbnRhaW5lci5wYXJzZUJvdW5kcygpOw0KICAgICAgICB3cmFwcGVyLnN0eWxlLnBvc2l0aW9uID0gImZpeGVkIjsNCiAgICAgICAgd3JhcHBlci5zdHlsZS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ScpOw0KICAgIHZhciBmYW1pbHkgPSBjb250YWluZXIucGFyZW50LmNzcygnZm9udEZhbWlseScpOw0KICAgIHZhciBzaGFkb3dzID0gY29udGFpbmVyLnBhcmVudC5wYXJzZVRleHRTaGFkb3dzKCk7DQoNCiAgICB0aGlzLnJlbmRlcmVyLmZvbnQoY29udGFpbmVyLnBhcmVudC5jb2xvcignY29sb3InKSwgY29udGFpbmVyLnBhcmVudC5jc3MoJ2ZvbnRTdHlsZScpLCBjb250YWluZXIucGFyZW50LmNzcygnZm9udFZhcmlhbnQnKSwgd2VpZ2h0LCBzaXplLCBmYW1pbHkpOw0KICAgIGlmIChzaGFkb3dzLmxlbmd0aCkgew0KICAgICAgICAvLyBUT0RPOiBzdXBwb3J0IG11bHRpcGxlIHRleHQgc2hhZG93cw0KICAgICAgICB0aGlzLnJlbmRlcmVyLmZvbnRTaGFkb3coc2hhZG93c1swXS5jb2xvciwgc2hhZG93c1swXS5vZmZzZXRYLCBzaGFkb3dzWzBdLm9mZnNldFksIHNoYWRvd3NbMF0uYmx1cik7DQogICAgfSBlbHNlIHsNCiAgICAgICAgdGhpcy5yZW5kZXJlci5jbGVhclNoYWRvdygpOw0KICAgIH0NCg0KICAgIHRoaXMucmVuZGVyZXIuY2xpcChjb250YWluZXIucGFyZW50LmNsaXAsIGZ1bmN0aW9uKCkgew0KICAgICAgICB0ZXh0TGlzdC5tYXAodGhpcy5wYXJzZVRleHRCb3VuZHMoY29udGFpbmVyKSwgdGhpcykuZm9yRWFjaChmdW5jdGlvbihib3VuZHMsIGluZGV4KSB7DQogICAgICAgICAgICBpZiAoYm91bmRzKSB7DQogICAgICAgICAgICAgICAgdGhpcy5yZW5kZXJlci50ZXh0KHRleHRMaXN0W2luZGV4XSwgYm91bmRzLmxlZnQsIGJvdW5kcy5ib3R0b20pOw0KICAgICAgICAgICAgICAgIHRoaXMucmVuZGVyVGV4dERlY29yYXRpb24oY29udGFpbmVyLnBhcmVudCwgYm91bmRzLCB0aGlzLmZ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VuZHMubGVmdDsNCiAgICAgICAgICAgIHZhciBieSA9IG5vZGVCb3VuZHMudG9wOw0KICAgICAgICAgICAgdmFyIGJ3ID0gbm9kZUJvdW5kcy53aWR0aDsNCiAgICAgICAgICAgIHZhciBiaCA9IG5vZGVCb3VuZHMuaGVpZ2h0IC0gKGJvcmRlcnNbMl0ud2lkdGgpOw0KDQogICAgICAgICAgICBzd2l0Y2goYm9yZGVyU2lkZSkgew0KICAgICAgICAgICAgY2FzZSAwOg0KICAgICAgICAgICAgICAgIC8vIHRvcCBib3JkZXINCiAgICAgICAgICAgICAgICBiaCA9IGJvcmRlcnNbMF0ud2lkdGg7DQogICAgICAgICAgICAgICAgYm9yZGVyLmFyZ3MgPSBkcmF3U2lkZSh7DQogICAgICAgICAgICAgICAgICAgICAgICBjMTogW2J4LCBieV0sDQogICAgICAgICAgICAgICAgICAgICAgICBjMjogW2J4ICsgYncsIGJ5XSwNCiAgICAgICAgICAgICAgICAgICAgICAgIGMzOiBbYnggKyBidyAtIGJvcmRlcnNbMV0ud2lkdGgsIGJ5ICsgYmhdLA0KICAgICAgICAgICAgICAgICAgICAgICAgYzQ6IFtieCArIGJvcmRlcnNbM10ud2lkdGgsIGJ5ICsgYmhdDQogICAgICAgICAgICAgICAgICAgIH0sIHJhZGl1c1swXSwgcmFkaXVzWzFdLA0KICAgICAgICAgICAgICAgICAgICBib3JkZXJQb2ludHMudG9wTGVmdE91dGVyLCBib3JkZXJQb2ludHMudG9wTGVmdElubmVyLCBib3JkZXJQb2ludHMudG9wUmlnaHRPdXRlciwgYm9yZGVyUG9pbnRzLnRvcFJpZ2h0SW5uZXIpOw0KICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgICAgY2FzZSAxOg0KICAgICAgICAgICAgICAgIC8vIHJpZ2h0IGJvcmRlcg0KICAgICAgICAgICAgICAgIGJ4ID0gbm9kZUJvdW5kcy5sZWZ0ICsgbm9kZUJvdW5kcy53aWR0aCAtIChib3JkZXJzWzFdLndpZHRoKTsNCiAgICAgICAgICAgICAgICBidyA9IGJvcmRlcnNbMV0ud2lkdGg7DQoNCiAgICAgICAgICAgICAgICBib3JkZXIuYXJncyA9IGRyYXdTaWRlKHsNCiAgICAgICAgICAgICAgICAgICAgICAgIGMxOiBbYnggKyBidywgYnldLA0KICAgICAgICAgICAgICAgICAgICAgICAgYzI6IFtieCArIGJ3LCBieSArIGJoICsgYm9yZGVyc1syXS53aWR0aF0sDQogICAgICAgICAgICAgICAgICAgICAgICBjMzogW2J4LCBieSArIGJoXSwNCiAgICAgICAgICAgICAgICAgICAgICAgIGM0OiBbYngsIGJ5ICsgYm9yZGVyc1swXS53aWR0aF0NCiAgICAgICAgICAgICAgICAgICAgfSwgcmFkaXVzWzFdLCByYWRpdXNbMl0sDQogICAgICAgICAgICAgICAgICAgIGJvcmRlclBvaW50cy50b3BSaWdodE91dGVyLCBib3JkZXJQb2ludHMudG9wUmlnaHRJbm5lciwgYm9yZGVyUG9pbnRzLmJvdHRvbVJpZ2h0T3V0ZXIsIGJvcmRlclBvaW50cy5ib3R0b21SaWdodElubmVyKTsNCiAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgIGNhc2UgMjoNCiAgICAgICAgICAgICAgICAvLyBib3R0b20gYm9yZGVyDQogICAgICAgICAgICAgICAgYnkgPSAoYnkgKyBub2RlQm91bmRzLmhlaWdodCkgLSAoYm9yZGVyc1syXS53aWR0aCk7DQogICAgICAgICAgICAgICAgYmggPSBib3JkZXJzWzJdLndpZHRoOw0KICAgICAgICAgICAgICAgIGJvcmRlci5hcmdzID0gZHJhd1NpZGUoew0KICAgICAgICAgICAgICAgICAgICAgICAgYzE6IFtieCArIGJ3LCBieSArIGJoXSwNCiAgICAgICAgICAgICAgICAgICAgICAgIGMyOiBbYngsIGJ5ICsgYmhdLA0KICAgICAgICAgICAgICAgICAgICAgICAgYzM6IFtieCArIGJvcmRlcnNbM10ud2lkdGgsIGJ5XSwNCiAgICAgICAgICAgICAgICAgICAgICAgIGM0OiBbYnggKyBidyAtIGJvcmRlcnNbM10ud2lkdGgsIGJ5XQ0KICAgICAgICAgICAgICAgICAgICB9LCByYWRpdXNbMl0sIHJhZGl1c1szXSwNCiAgICAgICAgICAgICAgICAgICAgYm9yZGVyUG9pbnRzLmJvdHRvbVJpZ2h0T3V0ZXIsIGJvcmRlclBvaW50cy5ib3R0b21SaWdodElubmVyLCBib3JkZXJQb2ludHMuYm90dG9tTGVmdE91dGVyLCBib3JkZXJQb2ludHMuYm90dG9tTGVmdElubmVyKTsNCiAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgIGNhc2UgMzoNCiAgICAgICAgICAgICAgICAvLyBsZWZ0IGJvcmRlcg0KICAgICAgICAgICAgICAgIGJ3ID0gYm9yZGVyc1szXS53aWR0aDsNCiAgICAgICAgICAgICAgICBib3JkZXIuYXJncyA9IGRyYXdTaWRlKHsNCiAgICAgICAgICAgICAgICAgICAgICAgIGMxOiBbYngsIGJ5ICsgYmggKyBib3JkZXJzWzJdLndpZHRoXSwNCiAgICAgICAgICAgICAgICAgICAgICAgIGMyOiBbYngsIGJ5XSwNCiAgICAgICAgICAgICAgICAgICAgICAgIGMzOiBbYnggKyBidywgYnkgKyBib3JkZXJzWzBdLndpZHRoXSwNCiAgICAgICAgICAgICAgICAgICAgICAgIGM0OiBbYnggKyBidywgYnkgKyBiaF0NCiAgICAgICAgICAgICAgICAgICAgfSwgcmFkaXVzWzNdLCByYWRpdXNbMF0sDQogICAgICAgICAgICAgICAgICAgIGJvcmRlclBvaW50cy5ib3R0b21MZWZ0T3V0ZXIsIGJvcmRlclBvaW50cy5ib3R0b21MZWZ0SW5uZXIsIGJvcmRlclBvaW50cy50b3BMZWZ0T3V0ZXIsIGJvcmRlclBvaW50cy50b3BMZWZ0SW5uZXIpOw0KICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9DQogICAgICAgIHJldHVybiBib3JkZXI7DQogICAgfSk7DQp9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mVyOiBnZXRDdXJ2ZVBvaW50cyh4ICsgYm9yZGVyc1szXS53aWR0aCwgeSArIGxlZnRIZWlnaHQsIE1hdGgubWF4KDAsIGJsaCAtIGJvcmRlcnNbM10ud2lkdGgpLCBibHYgLSBib3JkZXJzWzJdLndpZHRoKS5ib3R0b21MZWZ0LnN1YmRpdmlkZSgwLjUpDQogICAgfTsNCn0NCg0KZnVuY3Rpb24gYmV6aWVyQ3VydmUoc3RhcnQsIHN0YXJ0Q29udHJvbCwgZW5kQ29udHJvbCwgZW5kKSB7DQogICAgdmFyIGxlcnAgPSBmdW5jdGlvbiAoYSwgYiwgdCkgew0KICAgICAgICByZXR1cm4gew0KICAgICAgICAgICAgeDogYS54ICsgKGIueCAtIGEueCkgKiB0LA0KICAgICAgICAgICAgeTogYS55ICsgKGIueSAtIGEueSkgKiB0DQogICAgICAgIH07DQogICAgfTsNCg0KICAgIHJldHVybiB7DQogICAgICAgIHN0YXJ0OiBzdGFydCwNCiAgICAgICAgc3RhcnRDb250cm9sOiBzdGFydENvbnRyb2wsDQogICAgICAgIGVuZENvbnRyb2w6IGVuZENvbnRyb2wsDQogICAgICAgIGVuZDogZW5kLA0KICAgICAgICBzdWJkaXZpZGU6IGZ1bmN0aW9uKHQpIHsNCiAgICAgICAgICAgIHZhciBhYiA9IGxlcnAoc3RhcnQsIHN0YXJ0Q29udHJvbCwgdCksDQogICAgICAgICAgICAgICAgYmMgPSBsZXJwKHN0YXJ0Q29udHJvbCwgZW5kQ29udHJvbCwgdCksDQogICAgICAgICAgICAgICAgY2QgPSBsZXJwKGVuZENvbnRyb2wsIGVuZCwgdCksDQogICAgICAgICAgICAgICAgYWJiYyA9IGxlcnAoYWIsIGJjLCB0KSwNCiAgICAgICAgICAgICAgICBiY2NkID0gbGVycChiYywgY2QsIHQpLA0KICAgICAgICAgICAgICAgIGRlc3QgPSBsZXJwKGFiYmMsIGJjY2QsIHQpOw0KICAgICAgICAgICAgcmV0dXJuIFtiZXppZXJDdXJ2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ZSgNCiAgICAgICAgaW1hZ2VDb250YWluZXIsDQogICAgICAgIDAsDQogICAgICAgIDAsDQogICAgICAgIGltYWdlQ29udGFpbmVyLmltYWdlLndpZHRoIHx8IHdpZHRoLA0KICAgICAgICBpbWFnZUNvbnRhaW5lci5pbWFnZS5oZWlnaHQgfHwgaGVpZ2h0LA0KICAgICAgICBib3VuZHMubGVmdCArIHBhZGRpbmdMZWZ0ICsgYm9yZGVyc1szXS53aWR0aCwNCiAgICAgICAgYm91bmRzLnRvcCArIHBhZGRpbmdUb3AgKyBib3JkZXJzWzBdLndpZHRoLA0KICAgICAgICB3aWR0aCwNCiAgICAgICAgaGVpZ2h0DQogICAgKTsNCn07DQoNClJlbmRlcmVyLnByb3RvdHlwZS5yZW5kZXJCYWNrZ3JvdW5kID0gZnVuY3Rpb24oY29udGFpbmVyLCBib3VuZHMsIGJvcmRlckRhdGEpIHsNCiAgICBpZiAoYm91bmRzLmhlaWdodCA+IDAgJiYgYm91bmRzLndpZHRoID4gMCkgew0KICAgICAgICB0aGlzLnJlbmRlckJhY2tncm91bmRDb2xvcihjb250YWluZXIsIGJvdW5kcyk7DQogICAgICAgIHRoaXMucmVuZGVyQmFja2dyb3VuZEltYWdlKGNvbnRhaW5lciwgYm91bmRzLCBib3JkZXJEYXRhKTsNCiAgICB9DQp9Ow0KDQpSZW5kZXJlci5wcm90b3R5cGUucmVuZGVyQmFja2dyb3VuZENvbG9yID0gZnVuY3Rpb24oY29udGFpbmVyLCBib3VuZHMpIHsNCiAgICB2YXIgY29sb3IgPSBjb250YWluZXIuY29sb3IoImJhY2tncm91bmRDb2xvciIpOw0KICAgIGlmICghY29sb3IuaXNUcmFuc3BhcmVudCgpKSB7DQogICAgICAgIHRoaXMucmVjdGFuZ2xlKGJvdW5kcy5sZWZ0LCBib3VuZHMudG9wLCBib3VuZHMud2lkdGgsIGJvdW5kcy5oZWlnaHQsIGNvbG9yKTsNCiAgICB9DQp9Ow0KDQpSZW5kZXJlci5wcm90b3R5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dW5kLWltYWdlIiwgYmFja2dyb3VuZEltYWdlLmFyZ3NbMF0pOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgYnJlYWs7DQogICAgICAgIGNhc2UgImxpbmVhci1ncmFkaWVudCI6DQogICAgICAgIGNhc2UgImdyYWRpZW50IjoNCiAgICAgICAgICAgIHZhciBncmFkaWVudEltYWdlID0gdGhpcy5pbWFnZXMuZ2V0KGJhY2tncm91bmRJbWFnZS52YWx1ZSk7DQogICAgICAgICAgICBpZiAoZ3JhZGllbnRJbWFnZSkgew0KICAgICAgICAgICAgICAgIHRoaXMucmVuZGVyQmFja2dyb3VuZEdyYWRpZW50KGdyYWRpZW50SW1hZ2UsIGJvdW5kcywgYm9yZGVyRGF0YSk7DQogICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICAgIGxvZygiRXJyb3IgbG9hZGluZyBiYWNrZ3JvdW5kLWltYWdlIiwgYmFja2dyb3VuZEltYWdlLmFyZ3NbMF0pOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgYnJlYWs7DQogICAgICAgIGNhc2UgIm5vbmUiOg0KICAgICAgICAgICAgYnJlYWs7DQogICAgICAgIGRlZmF1bHQ6DQogICAgICAgICAgICBsb2coIlVua25vd24gYmFja2dyb3VuZC1pbWFnZSB0eXBlIiwgYmFja2dyb3VuZEltYWdlLmFyZ3NbMF0pOw0KICAgICAgICB9DQogICAgfSwgdGhpcyk7DQp9Ow0KDQpSZW5kZXJlci5wcm90b3R5cGUucmVuZGVyQmFja2dyb3VuZFJlcGVhdGluZyA9IGZ1bmN0aW9uKGNvbnRhaW5lciwgYm91bmRzLCBpbWFnZUNvbnRhaW5lciwgaW5kZXgsIGJvcmRlckRhdGEpIHsNCiAgICB2YXIgc2l6ZSA9IGNvbnRhaW5lci5wYXJzZUJhY2tncm91bmRTaXplKGJvdW5kcywgaW1hZ2VDb250YWluZXIuaW1hZ2UsIGluZGV4KTsNCiAgICB2YXIgcG9zaXRpb24gPSBjb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gICAgICBkZWZhdWx0Og0KICAgICAgICAgICAgcmV0dXJuIHRleHQ7DQogICAgfQ0KfTsNCg0KZnVuY3Rpb24gY2FwaXRhbGl6ZShtLCBwMSwgcDIpIHsNCiAgICBpZiAobS5sZW5ndGggPiAwKSB7DQogICAgICAgIHJldHVybiBwMSArIHAyLnRvVXBwZXJDYXNlKCk7DQogICAgfQ0KfQ0KDQpmdW5jdGlvbiBXZWJraXRHcmFkaWVudENvbnRhaW5lcihpbWFnZURhdGEpIHsNCiAgICBHcmFkaWVudENvbnRhaW5lci5hcHBseSh0aGlzLCBhcmd1bWVudHMpOw0KICAgIHRoaXMudHlwZSA9IChpbWFnZURhdGEuYXJnc1swXSA9PT0gImxpbmVhciIpID8gdGhpcy5UWVBFUy5MSU5FQVIgOiB0aGlzLlRZUEVTLlJBRElBTDsNCn0NCg0KV2Via2l0R3JhZGllbnRDb250YWluZXIucHJvdG90eXBlID0gT2JqZWN0LmNyZWF0ZShHcmFkaWVudENvbnRhaW5lci5wcm90b3R5cGUpOw0KDQpmdW5jdGlvbiBYSFIodXJsKSB7DQogICAgcmV0dXJuIG5ldyBQcm9taXNlKGZ1bmN0aW9uKHJlc29sdmUsIHJlamVjdCkgew0KICAgICAgICB2YXIgeGhyID0gbmV3IFhNTEh0dHBSZXF1ZXN0KCk7DQogICAgICAgIHhoci5vcGVuKCdHRVQnLCB1cmwpOw0KDQogICAgICAgIHhoci5vbmxvYWQgPSBmdW5jdGlvbigpIHsNCiAgICAgICAgICAgIGlmICh4aHIuc3RhdHVzID09PSAyMDApIHsNCiAgICAgICAgICAgICAgICByZXNvbHZlKHhoci5yZXNwb25zZVRleHQpOw0KICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgICByZWplY3QobmV3IEVycm9yKHhoci5zdGF0dXNUZXh0KSk7DQogICAgICAgICAgICB9DQogICAgICAgIH07DQoNCiAgICAgICAgeGhyLm9uZXJyb3IgPSBmdW5jdGlvbigpIHsNCiAgICAgICAgIC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wYXJhbmdvLAogKiAgICBraW0zZXIsIG1mbywgYWxub3J0aCwgRmxhbWVuY28KICovCgovKioKICogQ3JlYXRlcyBuZXcganNQREYgZG9jdW1lbnQgb2JqZWN0IGluc3RhbmNlLgogKgogKiBAY2xhc3MKICogQHBhcmFtIG9yaWVudGF0aW9uIE9uZSBvZiAicG9ydHJhaXQiIG9yICJsYW5kc2NhcGUiIChvciBzaG9ydGN1dHMgInAiIChEZWZhdWx0KSwgImwiKQogKiBAcGFyYW0gdW5pdCAgICAgICAgTWVhc3VyZW1lbnQgdW5pdCB0byBiZSB1c2VkIHdoZW4gY29vcmRpbmF0ZXMgYXJlIHNwZWNpZmllZC4KICogICAgICAgICAgICAgICAgICAgIE9uZSBvZiAicHQiIChwb2ludHMpLCAibW0iIChEZWZhdWx0KSwgImNtIiwgImluIgogKiBAcGFyYW0gZm9ybWF0ICAgICAgT25lIG9mICdwYWdlRm9ybWF0cycgYXMgc2hvd24gYmVsb3csIGRlZmF1bHQ6IGE0CiAqIEByZXR1cm5zIHtqc1BERn0KICogQG5hbWUganNQREYKICovCnZhciBqc1BERiA9IGZ1bmN0aW9uIChnbG9iYWwpIHsKICAndXNlIHN0cmljdCc7CgogIHZhciBwZGZWZXJzaW9uID0gJzEuMycsCiAgICAgIHBhZ2VGb3JtYXRzID0geyAvLyBTaXplIGluIHB0IG9mIHZhcmlvdXMgcGFwZXIgZm9ybWF0cwogICAgJ2EwJzogWzIzODMuOTQsIDMzNzAuMzldLAogICAgJ2ExJzogWzE2ODMuNzgsIDIzODMuOTRdLAogICAgJ2EyJzogWzExOTAuNTUsIDE2ODMuNzhdLAogICAgJ2EzJzogWzg0MS44OSwgMTE5MC41NV0sCiAgICAnYTQnOiBbNTk1LjI4LCA4NDEuODldLAogICAgJ2E1JzogWzQxOS41MywgNTk1LjI4XSwKICAgICdhNic6IFsyOTcuNjQsIDQxOS41M10sCiAgICAnYTcnOiBbMjA5Ljc2LCAyOTcuNjRdLAogICAgJ2E4JzogWzE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rva2VuXSkgewogICAgICAgICAgZGVsZXRlIHRvcGljc1t0b3BpY11bdG9rZW5dOwogICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgfQogICAgICB9CiAgICAgIHJldHVybiBmYWxzZTsKICAgIH07CgogICAgdGhpcy5wdWJsaXNoID0gZnVuY3Rpb24gKHRvcGljKSB7CiAgICAgIGlmICh0b3BpY3MuaGFzT3duUHJvcGVydHkodG9waWMpKSB7CiAgICAgICAgdmFyIGFyZ3MgPSBBcnJheS5wcm90b3R5cGUuc2xpY2UuY2FsbChhcmd1bWVudHMsIDEpLAogICAgICAgICAgICBpZHIgPSBbXTsKCiAgICAgICAgZm9yICh2YXIgaWQgaW4gdG9waWNzW3RvcGljXSkgewogICAgICAgICAgdmFyIHN1YiA9IHRvcGljc1t0b3BpY11baWRdOwogICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgc3ViWzBdLmFwcGx5KGNvbnRleHQsIGFyZ3MpOwogICAgICAgICAgfSBjYXRjaCAoZXgpIHsKICAgICAgICAgICAgaWYgKGdsb2JhbC5jb25zb2xlKSB7CiAgICAgICAgICAgICAgY29uc29sZS5lcnJvcignanNQREYgUHViU3ViIEVycm9yJywgZXgubWVzc2FnZSwgZXgpOwogICAgICAgICAgICB9CiAgICAgICAgICB9CiAgICAgICAgICBpZiAoc3ViWzFdKSBpZHIucHVzaChpZCk7CiAgICAgICAgfQogICAgICAgIGlmIChpZHIubGVuZ3RoKSBpZHIuZm9yRWFjaCh0aGlzLnVuc3Vic2NyaWJlKTsKICAgICAgfQogICAgfTsKICB9CgogIC8qKgogICAqIEBjb25zdHJ1Y3RvcgogICAqIEBwcml2YXRlCiAgICovCiAgZnVuY3Rpb24ganNQREYob3JpZW50YXRpb24sIHVuaXQsIGZvcm1hdCwgY29tcHJlc3NQZGYpIHsKICAgIHZhciBvcHRpb25zID0ge307CgogICAgaWYgKCh0eXBlb2Ygb3JpZW50YXRpb24gPT09ICd1bmRlZmluZWQnID8gJ3VuZGVm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VkaW0KICAgIHBhZ2VkaW0gPSBbXSwKICAgICAgICBjb250ZW50ID0gW10sCiAgICAgICAgYWRkaXRpb25hbE9iamVjdHMgPSBbXSwKICAgICAgICBsaW5lQ2FwSUQgPSAwLAogICAgICAgIGxpbmVKb2luSUQgPSAwLAogICAgICAgIGNvbnRlbnRfbGVuZ3RoID0gMCwKICAgICAgICBwYWdlV2lkdGgsCiAgICAgICAgcGFnZUhlaWdodCwKICAgICAgICBwYWdlTW9kZSwKICAgICAgICB6b29tTW9kZSwKICAgICAgICBsYXlvdXRNb2RlLAogICAgICAgIGRvY3VtZW50UHJvcGVydGllcyA9IHsKICAgICAgJ3RpdGxlJzogJycsCiAgICAgICdzdWJqZWN0JzogJycsCiAgICAgICdhdXRob3InOiAnJywKICAgICAgJ2tleXdvcmRzJzogJycsCiAgICAgICdjcmVhdG9yJzogJycKICAgIH0sCiAgICAgICAgQVBJID0ge30sCiAgICAgICAgZXZlbnRzID0gbmV3IFB1YlN1YihBUEkpLAoKCiAgICAvLy8vLy8vLy8vLy8vLy8vLy8vLy8KICAgIC8vIFByaXZhdGUgZnVuY3Rpb25zCiAgICAvLy8vLy8vLy8vLy8vLy8vLy8vLy8KICAgIGYyID0gZnVuY3Rpb24gZjIobnVtYmVyKSB7CiAgICAgIHJldHVybiBudW1iZXIudG9GaXhlZCgyKTsgLy8gSWUsICUuMmYKICAgIH0sCiAgICAgICAgZjMgPSBmdW5jdGlvbiBmMyhudW1iZXIpIHsKICAgICAgcmV0dXJuIG51bWJlci50b0ZpeGVkKDMpOyAvLyBJZSwgJS4zZgogICAgfSwKICAgICAgICBwYWRkMiA9IGZ1bmN0aW9uIHBhZGQyKG51bWJlcikgewogICAgICByZXR1cm4gKCcwJyArIHBhcnNlSW50KG51bWJlcikpLnNsaWNlKC0yKTsKICAgIH0sCiAgICAgICAgb3V0ID0gZnVuY3Rpb24gb3V0KHN0cmluZykgewogICAgICBpZiAob3V0VG9QYWdlcykgewogICAgICAgIC8qIHNldCBie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ewogICAgICB2YXIgb2JqSWQgPSBwYWdlcy5sZW5ndGggKiAyICsgMTsKICAgICAgb2JqSWQgKz0gYWRkaXRpb25hbE9iamVjdHMubGVuZ3RoOwogICAgICB2YXIgb2JqID0gewogICAgICAgIG9iaklkOiBvYmpJZCwKICAgICAgICBjb250ZW50OiAnJwogICAgICB9OwogICAgICBhZGRpdGlvbmFsT2JqZWN0cy5wdXNoKG9iaik7CiAgICAgIHJldHVybiBvYmo7CiAgICB9LAoKICAgIC8vIERvZXMgbm90IG91dHB1dCB0aGUgb2JqZWN0LiAgVGhlIGNhbGxlciBtdXN0IGNhbGwgbmV3T2JqZWN0RGVmZXJyZWRCZWdpbihvaWQpIGJlZm9yZSBvdXRwdXRpbmcgYW55IGRhdGEKICAgIG5ld09iamVjdERlZmVycmVkID0gZnVuY3Rpb24gbmV3T2JqZWN0RGVmZXJyZWQoKSB7CiAgICAgIG9iamVjdE51bWJlcisrOwogICAgICBvZmZzZXRzW29iamVjdE51bWJlcl0gPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgcmV0dXJuIGNvbnRlbnRfbGVuZ3RoOwogICAgICB9OwogICAgICByZXR1cm4gb2JqZWN0TnVtYmVyOwogICAgfSwKICAgICAgICBuZXdPYmplY3REZWZlcnJlZEJlZ2luID0gZnVuY3Rpb24gbmV3T2JqZWN0RGVmZXJyZWRCZWdpbihvaWQpIHsKICAgICAgb2Zmc2V0c1tvaWRdID0gY29udGVudF9sZW5ndGg7CiAgICB9LAogICAgICAgIHB1dFN0cmVhbSA9IGZ1bmN0aW9uIHB1dFN0cmVhbShzdHIpIHsKICAgICAgb3V0KCdzdHJlYW0nKTsKICAgICAgb3V0KHN0cik7CiAgICAgIG91dCgnZW5kc3RyZWFtJyk7CiAgICB9LAogICAgICAgIHB1dFBhZ2VzID0gZnVuY3Rpb24gcHV0UGFnZXMoKSB7CiAgICAgIHZhciBuLAogICAgICAgICAgcCwKICAgICAgICAgIGFyciwKICAgICAgICAgIGksCiAgICAgICAgICBkZWZsYXRlciwKICAgICAgICAgIGFkbGVyMzIsCiAgICAgICAgICBhZGxlcjMyY3MsCiAgICAgICAgICB3UHQsCiAgICAgICAgICBoUHQsCiAgICAgICAgICBwYWdlT2JqZWN0TnVtYmVycyA9IFtdOwoKICAgICAgYWRsZXIzMmNzID0gZ2xvYmFsLmFkbGVyMzJjcyB8fCBqc1BERi5hZGxlcjMyY3M7CiAgICAgIGlmIChjb21wcmVzcyAmJiB0eXBlb2YgYWRsZXIzMmNzID09PSAndW5kZWZpbmVkJykgewogICAgICAgIGNvbXByZXNzID0gZmFsc2U7CiAgICAgIH0KCiAgICAgIC8vIG91dFRvUGFnZXMgPSBmYWxzZSBhcyBzZXQgaW4gZW5kRG9jdW1lbnQoKS4gb3V0KCkgd3JpdGVzIHRvIGNvbnRlbnQuCgogICAgICBmb3IgKG4gPSAxOyBuIDw9IHBhZ2U7IG4rKykgewogICAgICAgIHBhZ2VPYmplY3ROdW1iZXJzLnB1c2gobmV3T2JqZWN0KCkpOwogICAgICAgIHdQdCA9IChwYWdlV2lkdGggPSBwYWdlZGltW25dLndpZHRoKSAqIGs7CiAgICAgICAgaFB0ID0gKHBhZ2VIZWlnaHQgPSBwYWdlZGltW25dLmhlaWdodCkgKiBrOwogICAgICAgIG91dCgnPDwvVHlwZSAvUGFnZScpOwogICAgICAgIG91dCgnL1BhcmVudCAxIDAgUicpOwogICAgICAgIG91dCgnL1Jlc291cmNlcyAyIDAgUicpOwogICAgICAgIG91dCgnL01lZGlhQm94IFswIDAgJyArIGYyKHdQdCkgKyAnICcgKyBmMihoUHQpICsgJ10nKTsKICAgICAgICAvLyBBZGRlZCBmb3IgYW5ub3RhdGlvbiBwbHVnaW4KICAgICAgICBldmVudHMucHVibGlzaCgncHV0UGFnZScsIHsKICAgICAgICAgIHBhZ2VOdW1iZXI6IG4sCiAgICAgICAgICBwYWdlOiBwYWdlc1tuXQogICAgICAgIH0pOwogICAgICAgIG91dCgnL0NvbnRlbnRzICcgKyAob2JqZWN0TnVtYmVyICsgMSkgKyAnIDAgUicpOwogICAgICAgIG91dCgnPj4nKTsKICAgICAgICBvdXQoJ2VuZG9iaicpOwoKICAgICAgICAvLyBQYWdlIGNvbnRlbnQKICAgICAgICBwID0gcGFnZXNbbl0uam9pbignXG4nKTsKICAgICAgICBuZXdPYmplY3QoKTsKICAgICAgICBpZiAoY29tcHJlc3MpIHsKICAgICAgICAgIGFyciA9IFtdOwogICAgICAgICAgaSA9IHAubGVuZ3RoOwogICAgICAgICAgd2hpbGUgKGktLSkgewogICAgICAgICAgICBhcnJbaV0gPSBwLmNoYXJDb2RlQXQoaSk7CiAgICAgICAgICB9CiAgICAgICAgICBhZGxlcjMyID0gYWRsZXIzMmNzLmZyb20ocCk7CiAgICAgICAgICBkZWZsYXRlciA9IG5ldyBEZWZsYXRlcig2KTsKICAgICAgICAgIGRlZmxhdGVyLmFwcGVuZChuZXcgVWludDhBcnJheShhcnIpKTsKICAgICAgICAgIHAgPSBkZWZsYXRlci5mbHVzaCgpOwogICAgICAgICAgYXJyID0gbmV3IFVpbnQ4QXJyYXkocC5sZW5ndGggKyA2KTsKICAgICAgICAgIGFyci5zZXQobmV3IFVpbnQ4QXJyYXkoWzEyMCwgMTU2XSkpLCBhcnIuc2V0KHAsIDIpOwogICAgICAgICAgYXJyLnNldChuZXcgVWludDhBcnJheShbYWRsZXIzMiAmIDB4RkYsIGFkbGVyMzIgPj4gOCAmIDB4RkYsIGFkbGVyMzIgPj4gMTYgJiAweEZGLCBhZGxlcjMyID4+IDI0ICYgMHhGRl0pLCBwLmxlbmd0aCArIDIpOwogICAgICAgICAgcCA9IFN0cmluZy5mcm9tQ2hhckNvZGUuYXBwbHkobnVsbCwgYXJyKTsKICAgICAgICAgIG91dCgnPDwvTGVuZ3RoICcgKyBwLmxlbmd0aCArICcgL0ZpbHRlciBbL0ZsYXRlRGVjb2RlXT4+Jyk7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgIG91dCgnPDwvTGVuZ3RoICcgKyBwLmxlbmd0aCArICc+PicpOwogICAgICAgIH0KICAgICAgICBwdXRTdHJlYW0ocCk7CiAgICAgICAgb3V0KCdlbmRvYmonKTsKICAgICAgfQogICAgICBvZmZzZXRzWzFdID0gY29udGVudF9sZW5ndGg7CiAgICAgIG91dCgnMSAwIG9iaicpOwogICAgICBvdXQoJzw8L1R5cGUgL1BhZ2VzJyk7CiAgICAgIHZhciBraWRzID0gJy9LaWRzIFsnOwogICAgICBmb3IgKGkgPSAwOyBpIDwgcGFnZTsgaSsrKSB7CiAgICAgICAga2lkcyArPSBwYWdlT2JqZWN0TnVtYmVyc1tpXSArICcgMCBSICc7CiAgICAgIH0KICAgICAgb3V0KGtpZHMgKyAnXScpOwogICAgICBvdXQoJy9Db3VudCAnICsgcGFnZSk7CiAgICAgIG91dCgnPj4nKTsKICAgICAgb3V0KCdlbmRvYmonKTsKICAgICAgZXZlbnRzLnB1Ymxpc2goJ3Bvc3RQdXRQYWdlcycpOwogICAgfSwKICAgICAgICBwdXRGb250ID0gZnVuY3Rpb24gcHV0Rm9udChmb250KSB7CiAgICAgIGZvbnQub2JqZWN0TnVtYmVyID0gbmV3T2JqZWN0KCk7CiAgICAgIG91dCgnPDwvQmFzZUZvbnQvJyArIGZvbnQuUG9zdFNjcmlwdE5hbWUgKyAnL1R5cGUvRm9udCcpOwogICAgICBpZiAodHlwZW9mIGZvbnQuZW5jb2RpbmcgPT09ICdzdHJpbmcnKSB7CiAgICAgICAgb3V0KCcvRW5jb2RpbmcvJyArIGZvbnQuZW5jb2RpbmcpOwogICAgICB9CiAgICAgIG91dCgnL1N1YnR5cGUvVHlwZTE+PicpOwogICAgICBvdXQoJ2VuZG9iaicpOwogICAgfSwKICAgICAgICBwdXRGb250cyA9IGZ1bmN0aW9uIHB1dEZvbnRzKCkgewogICAgICBmb3IgKHZhciBmb250S2V5IGluIGZvbnRzKSB7CiAgICAgICAgaWYgKGZvbnRzLmhhc093blByb3BlcnR5KGZvbnRLZXkpKSB7CiAgICAgICAgICBwdXRGb250KGZvbnRzW2ZvbnRLZXldKTsKICAgICAgICB9CiAgICAgIH0KICAgIH0sCiAgICAgICAgcHV0WG9iamVjdERpY3QgPSBmdW5jdGlvbiBwdXRYb2JqZWN0RGljdCgpIHsKICAgICAgLy8gTG9vcCB0aHJvdWdoIGltYWdlcywgb3Igb3RoZXIgZGF0YSBvYmplY3RzCiAgICAgIGV2ZW50cy5wdWJsaXNoKCdwdXRYb2JqZWN0RGljdCcpOwogICAgfSwKICAgICAgICBwdXRSZXNvdXJjZURpY3Rpb25hcnkgPSBmdW5jdGlvbiBwdXRSZXNvdXJjZURpY3Rpb25hcnkoKSB7CiAgICAgIG91dCgnL1Byb2NTZXQgWy9QREYgL1RleHQgL0ltYWdlQiAvSW1hZ2VDIC9JbWFnZUldJyk7CiAgICAgIG91dCgnL0ZvbnQgPDwnKTsKCiAgICAgIC8vIERvIHRoaXMgZm9yIGVhY2ggZm9udCwgdGhlICcxJyBiaXQgaXMgdGhlIGluZGV4IG9mIHRoZSBmb250CiAgICAgIGZvciAodmFyIGZvbnRLZXkgaW4gZm9udHMpIHsKICAgICAgICBpZiAoZm9udHMuaGFzT3duUHJvcGVydHkoZm9udEtleSkpIHsKICAgICAgICAgIG91dCgnLycgKyBmb250S2V5ICsgJyAnICsgZm9udHNbZm9udEtleV0ub2JqZWN0TnVtYmVyICsgJyAwIFInKTsKICAgICAgICB9CiAgICAgIH0KICAgICAgb3V0KCc+PicpOwogICAgICBvdXQoJy9YT2JqZWN0IDw8Jyk7CiAgICAgIHB1dFhvYmplY3REaWN0KCk7CiAgICAgIG91dCgnPj4nKTsKICAgIH0sCiAgICAgICAgcHV0UmVzb3VyY2VzID0gZnVuY3Rpb24gcHV0UmVzb3VyY2VzKCkgewogICAgICBwdXRGb250cygpOwogICAgICBldmVudHMucHVibGlzaCgncHV0UmVzb3VyY2VzJyk7CiAgICAgIC8vIFJlc291cmNlIGRpY3Rpb25hcnkKICAgICAgb2Zmc2V0c1syXSA9IGNvbnRlbnRfbGVuZ3RoOwogICAgICBvdXQoJzIgMCBvYmonKTsKICAgICAgb3V0KCc8PCcpOwogICAgICBwdXRSZXNvdXJjZURpY3Rpb25hcnkoKTsKICAgICAgb3V0KCc+PicpOwogICAgICBvdXQoJ2VuZG9iaicpOwogICAgICBldmVudHMucHVibGlzaCgncG9zdFB1dFJlc291cmNlcycpOwogICAgfSwKICAgICAgICBwdXRBZGRpdGlvbmFsT2JqZWN0cyA9IGZ1bmN0aW9uIHB1dEFkZGl0aW9uYWxPYmplY3RzKCkgewogICAgICBldmVudHMucHVibGlzaCgncHV0QWRkaXRpb25hbE9iamVjdHMnKTsKICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBhZGRpdGlvbmFsT2JqZWN0cy5sZW5ndGg7IGkrKykgewogICAgICAgIHZhciBvYmogPSBhZGRpdGlvbmFsT2JqZWN0c1tpXTsKICAgICAgICBvZmZzZXRzW29iai5vYmpJZF0gPSBjb250ZW50X2xlbmd0aDsKICAgICAgICBvdXQob2JqLm9iaklkICsgJyAwIG9iaicpOwogICAgICAgIG91dChvYmouY29udGVudCk7CiAgICAgICAgb3V0KCdlbmRvYmonKTsKICAgICAgfQogICAgICBvYmplY3ROdW1iZXIgKz0gYWRkaXRpb25hbE9iamVjdHMubGVuZ3RoOwogICAgICBldmVudHMucHVibGlzaCgncG9zdFB1dEFkZGl0aW9uYWxPYmplY3RzJyk7CiAgICB9LAogICAgICAgIGFkZFRvRm9udERpY3Rpb25hcnkgPSBmdW5jdGlvbiBhZGRUb0ZvbnREaWN0aW9uYXJ5KGZvbnRLZXksIGZvbnROYW1lLCBmb250U3R5bGUpIHsKICAgICAgLy8gdGhpcyBpcyBtYXBwaW5nIHN0cnVjdHVyZSBmb3IgcXVpY2sgZm9udCBrZXkgbG9va3VwLgogICAgICAvLyByZXR1cm5zIHRoZSBLRVkgb2YgdGhlIGZvbnQgKGV4OiAiRjEiKSBmb3IgYSBnaXZlbgogICAgICAvLyBwYWly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KICAgICAgdmFyIGZvbnRLZXkgPSAnRicgKyAoT2JqZWN0LmtleXMoZm9udHMpLmxlbmd0aCArIDEpLnRvU3RyaW5nKDEwKSwKCiAgICAgIC8vIFRoaXMgaXMgRm9udE9iamVjdAogICAgICBmb250ID0gZm9udHNbZm9udEtleV0gPSB7CiAgICAgICAgJ2lkJzogZm9udEtleSwKICAgICAgICAnUG9zdFNjcmlwdE5hbWUnOiBQb3N0U2NyaXB0TmFtZSwKICAgICAgICAnZm9udE5hbWUnOiBmb250TmFtZSwKICAgICAgICAnZm9udFN0eWxlJzogZm9udFN0eWxlLAogICAgICAgICdlbmNvZGluZyc6IGVuY29kaW5nLAogICAgICAgICdtZXRhZGF0YSc6IHt9CiAgICAgIH07CiAgICAgIGFkZFRvRm9udERpY3Rpb25hcnkoZm9udEtleSwgZm9udE5hbWUsIGZvbnRTdHlsZSk7CiAgICAgIGV2ZW50cy5wdWJsaXNoKCdhZGRGb250JywgZm9udCk7CgogICAgICByZXR1cm4gZm9udEtleTsKICAgIH0sCiAgICAgICAgYWRkRm9udHMgPSBmdW5jdGlvbiBhZGRGb250cygpIHsKCiAgICAgIHZhciBIRUxWRVRJQ0EgPSAiaGVsdmV0aWNhIiwKICAgICAgICAgIFRJTUVTID0gInRpbWVzIiwKICAgICAgICAgIENPVVJJRVIgPSAiY291cmllciIsCiAgICAgICAgICBOT1JNQUwgPSAibm9ybWFsIiwKICAgICAgICAgIEJPTEQgPSAiYm9sZCIsCiAgICAgICAgICBJVEFMSUMgPSAiaXRhbGljIiwKICAgICAgICAgIEJPTERfSVRBTElDID0gImJvbGRpdGFsaWMiLAogICAgICAgICAgZW5jb2RpbmcgPSAnU3RhbmRhcmRFbmNvZGluZycsCiAgICAgICAgICBaQVBGID0gInphcGZkaW5nYmF0cyIsCiAgICAgICAgICBzdGFuZGFyZEZvbnRzID0gW1snSGVsdmV0aWNhJywgSEVMVkVUSUNBLCBOT1JNQUxdLCBbJ0hlbHZldGljYS1Cb2xkJywgSE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NoKCdhZGRGb250cycsIHsKICAgICAgICBmb250czogZm9udHMsCiAgICAgICAgZGljdGlvbmFyeTogZm9udG1hcAogICAgICB9KTsKICAgIH0sCiAgICAgICAgU0FGRSA9IGZ1bmN0aW9uIF9fc2FmZUNhbGwoZm4pIHsKICAgICAgZm4uZm9vID0gZnVuY3Rpb24gX19zYWZlQ2FsbFdyYXBwZXIoKSB7CiAgICAgICAgdHJ5IHsKICAgICAgICAgIHJldHVybiBmbi5hcHBseSh0aGlzLCBhcmd1bWVudHMpOwogICAgICAgIH0gY2F0Y2ggKGUpIHsKICAgICAgICAgIHZhciBzdGFjayA9IGUuc3RhY2sgfHwgJyc7CiAgICAgICAgICBpZiAofnN0YWNrLmluZGV4T2YoJyBhdCAnKSkgc3RhY2sgPSBzdGFjay5zcGxpdCgiIGF0ICIpWzFdOwogICAgICAgICAgdmFyIG0gPSAiRXJyb3IgaW4gZnVuY3Rpb24gIiArIHN0YWNrLnNwbGl0KCJcbiIpWzBdLnNwbGl0KCc8JylbMF0gKyAiOiAiICsgZS5tZXNzYWdlOwogICAgICAgICAgaWYgKGdsb2JhbC5jb25zb2xlKSB7CiAgICAgICAgICAgIGdsb2JhbC5jb25zb2xlLmVycm9yKG0sIGUpOwogICAgICAgICAgICBpZiAoZ2xvYmFsLmFsZXJ0KSBhbGVydChtKTsKICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihtKTsKICAgICAgICAgIH0KICAgICAgICB9CiAgICAgIH07CiAgICAgIGZuLmZvby5iYXIgPSBmbjsKICAgICAgcmV0dXJuIGZuLmZvbzsKICAgIH0sCiAgICAgICAgdG84Yml0U3RyZWFtID0gZnVuY3Rpb24gdG84Yml0U3RyZWFtKHRleHQsIGZsYWdzKSB7CiAgICAgIC8qKgogICAgICAgKiBQREYgMS4zIHNwZWM6CiAgICAgICAqICJGb3IgdGV4dCBzdHJpbmdzIGVuY29kZWQgaW4gVW5pY29kZSwgdGhlIGZpcnN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4gdG8gQVBJLnRleHQoLi4sIGZsYWdzKSApCiAgICAgICAqIGZsYWdzLmF1dG9lbmNvZGUgPSB0cnVlCiAgICAgICAqIGZsYWdzLm5vQk9NID0gdHJ1ZQogICAgICAgKgogICAgICAgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQogICAgICAgKiBgZmxhZ3NgIHByb3BlcnRpZXMgcmVsaWVkIHVwb246CiAgICAgICAqICAgLnNvdXJjZUVuY29kaW5nID0gc3RyaW5nIHdpdGggZW5jb2RpbmcgbGFiZWwuCiAgICAgICAqICAgICAgICAgICAgICAgICAgICAgIlVuaWNvZGUiIGJ5IGRlZmF1bHQuID0gZW5jb2Rpbmcgb2YgdGhlIGluY29taW5nIHRleHQuCiAgICAgICAqICAgICAgICAgICAgICAgICAgICAgcGFzcyBzb21lIG5vbi1leGlzdGluZyBlbmNvZGluZyBuYW1lCiAgICAgICAqICAgICAgICAgICAgICAgICAgICAgKGV4OiAnRG8gbm90IHRvdWNoIG15IHN0cmluZ3MhIEkga25vdyB3aGF0IEkgYW0gZG9pbmcuJykKICAgICAgICogICAgICAgICAgICAgICAgICAgICB0byBtYWtlIGVuY29kaW5nIGNvZGUgc2tpcCB0aGUgZW5jb2Rpbmcgc3RlcC4KICAgICAgICogICAub3V0cHV0RW5jb2RpbmcgPSBFaXRoZXIgdmFsaWQgUERGIGVuY29kaW5nIG5hbWUKICAgICAgICogICAgICAgICAgICAgICAgICAgICAobXVzdCBiZSBzdXBwb3J0ZWQgYnkganNQREYgZm9udCBtZXRyaWNzLCBvdGhlcndpc2Ugbm8gZW5jb2RpbmcpCiAgICAgICAqICAgICAgICAgICAgICAgICAgICAgb3IgYSBKUyBvYmplY3QsIHdoZXJlIGtleSA9IHNvdXJjZUNoYXJDb2RlLCB2YWx1ZSA9IG91dHB1dENoYXJDb2RlCiAgICAgICAqICAgICAgICAgICAgICAgICAgIC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2RlUGFnZXMpIHsKICAgICAgICAgIG91dHB1dEVuY29kaW5nID0gZW5jb2RpbmdCbG9jay5jb2RlUGFnZXNbMF07IC8vIGxldCdzIHNheSwgZmlyc3Qgb25lIGlzIHRoZSBkZWZhdWx0CiAgICAgICAgfQoKICAgICAgICBpZiAodHlwZW9mIG91dHB1dEVuY29kaW5nID09PSAnc3RyaW5nJykgewogICAgICAgICAgb3V0cHV0RW5jb2RpbmcgPSBlbmNvZGluZ0Jsb2NrW291dHB1dEVuY29kaW5nXTsKICAgICAgICB9CiAgICAgICAgLy8gd2Ugd2FudCBvdXRwdXQgZW5jb2RpbmcgdG8gYmUgYSBKUyBPYmplY3QsIHdoZXJlCiAgICAgICAgLy8ga2V5ID0gc291cmNlRW5jb2RpbmcncyBjaGFyYWN0ZXIgY29kZSBhbmQKICAgICAgICAvLyB2YWx1ZSA9IG91dHB1dEVuY29kaW5nJ3MgY2hhcmFjdGVyIGNvZGUuCiAgICAgICAgaWYgKG91dHB1dEVuY29kaW5nKSB7CiAgICAgICAgICBpc1VuaWNvZGUgPSBmYWxzZTsKICAgICAgICAgIG5ld3RleHQgPSBbXTsKICAgICAgICAgIGZvciAoaSA9IDAsIGwgPSB0ZXh0Lmxlbmd0aDsgaSA8IGw7IGkrKykgewogICAgICAgICAgICBjaCA9IG91dHB1dEVuY29kaW5nW3RleHQuY2hhckNvZGVBdChpKV07CiAgICAgICAgICAgIGlmIChjaCkgewogICAgICAgICAgICAgIG5ld3RleHQucHVzaChTdHJpbmcuZnJvbUNoYXJDb2RlKGNoKSk7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgbmV3dGV4dC5wdXNoKHRleHRbaV0pOwogICAgICAgICAgICB9CgogICAgICAgICAgICAvLyBzaW5jZSB3ZSBhcmUgbG9vcGluZyBvdmVyIGNoYXJzIGFueXdheSwgbWlnaHQgYXMgd2VsbAogICAgICAgICAgICAvLyBjaGVjayBmb3IgcmVzaWR1YWwgdW5pY29kZW5lc3MKICAgICAgICAgICAgaWYgKG5ld3RleHRbaV0uY2hhckNvZGVBdCgwKSA+PiA4KSB7CiAgICAgICAgICAgICAgLyogbW9yZSB0aGFuIDI1NSAqLwogICAgICAgICAgICAgIGlzVW5pY29kZSA9IHRydWU7CiAgICAgICAgICAgIH0KICAgICAgICAgIH0KICAgICAgICAgIHRleHQgPSBuZXd0ZXh0LmpvaW4oJycpOwogICAgICAgIH0KICAgICAgfQoKICAgICAgaSA9IHRleHQubGVuZ3RoOwogICAgICAvLyBpc1VuaWNvZGUgbWF5IGJlIHNldCB0byBmYWxzZSBhYm92ZS4gSGVuY2UgdGhlIHRyaXBsZS1lcXVhbCB0byB1bmRlZmluZWQKICAgICAgd2hpbGUgKGlzVW5pY29kZSA9PT0gdW5kZWZpbmVkICYmIGkgIT09IDApIHsKICAgICAgICBpZiAodGV4dC5jaGFyQ29kZUF0KGkgLSAxKSA+PiA4KSB7CiAgICAgICAgICAvKiBtb3JlIHRoYW4gMjU1ICovCiAgICAgICAgICBpc1VuaWNvZGUgPSB0cnVlOwogICAgICAgIH0KICAgICAgICBpLS07CiAgICAgIH0KICAgICAgaWYgKCFpc1VuaWNvZGUpIHsKICAgICAgICByZXR1cm4gdGV4dDsKICAgICAgfQoKICAgICAgbmV3dGV4dCA9IGZsYWdzLm5vQk9NID8gW10gOiBbMjU0LCAyNTVdOwogICAgICBmb3IgKGkgPSAwLCBsID0gdGV4dC5sZW5ndGg7IGkgPCBsOyBpKyspIHsKICAgICAgICBjaCA9IHRleHQuY2hhckNvZGVBdChpKTsKICAgICAgICBiY2ggPSBjaCA+PiA4OyAvLyBkaXZpZGUgYnkgMjU2CiAgICAgICAgaWYgKGJjaCA+PiA4KSB7CiAgICAgICAgICAvKiBzb21ldGhpbmcgbGVmdCBhZnRlciBkaXZpZGluZyBieSAyNTYgc2Vjb25kIHRpbWUgKi8KICAgICAgICAgIHRocm93IG5ldyBFcnJvcigiQ2hhcmFjdGVyIGF0IHBvc2l0aW9uICIgKy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BicmVhazsKICAgICAgICBjYXNlICdvcmlnaW5hbCc6CiAgICAgICAgICBvdXQoJy9PcGVuQWN0aW9uIFszIDAgUiAvWFlaIG51bGwgbnVsbCAxXScpOwogICAgICAgICAgYnJlYWs7CiAgICAgICAgZGVmYXVsdDoKICAgICAgICAgIHZhciBwY24gPSAnJyArIHpvb21Nb2RlOwogICAgICAgICAgaWYgKHBjbi5zdWJzdHIocGNuLmxlbmd0aCAtIDEpID09PSAnJScpIHpvb21Nb2RlID0gcGFyc2VJbnQoem9vbU1vZGUpIC8gMTAwOwogICAgICAgICAgaWYgKHR5cGVvZiB6b29tTW9kZSA9PT0gJ251bWJlcicpIHsKICAgICAgICAgICAgb3V0KCcvT3BlbkFjdGlvbiBbMyAwIFIgL1hZWiBudWxsIG51bGwgJyArIGYyKHpvb21Nb2RlKSArICddJyk7CiAgICAgICAgICB9CiAgICAgIH0KICAgICAgaWYgKCFsYXlvdXRNb2RlKSBsYXlvdXRNb2RlID0gJ2NvbnRpbnVvdXMnOwogICAgICBzd2l0Y2ggKGxheW91dE1vZGUpIHsKICAgICAgICBjYXNlICdjb250aW51b3VzJzoKICAgICAgICAgIG91dCgnL1BhZ2VMYXlvdXQgL09uZUNvbHVtbicpOwogICAgICAgICAgYnJlYWs7CiAgICAgICAgY2FzZSAnc2luZ2xlJzoKICAgICAgICAgIG91dCgnL1BhZ2VMYXlvdXQgL1NpbmdsZVBhZ2UnKTsKICAgICAgICAgIGJyZWFrOwogICAgICAgIGNhc2UgJ3R3byc6CiAgICAgICAgY2FzZSAndHdvbGVmdCc6CiAgICAgICAgICBvdXQoJy9QYWdlTGF5b3V0IC9Ud29Db2x1bW5MZWZ0Jyk7CiAgICAgICAgICBicmVhazsKICAgICAgICBjYXNlICd0d29yaWdodCc6CiAgICAgICAgICBvdXQoJy9QYWdlTGF5b3V0IC9Ud29Db2x1bW5SaWdodCcpOwogICAgICAgICAgYnJlYWs7CiAgICAgIH0KICAgICAgaWYgKHBhZ2VNb2RlKS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hdGlvbiA9IHR5cGVvZiBoZWlnaHQgPT09ICdzdHJpbmcnICYmIGhlaWdodC50b0xvd2VyQ2FzZSgpOwogICAgICBpZiAodHlwZW9mIHdpZHRoID09PSAnc3RyaW5nJykgewogICAgICAgIHZhciBmb3JtYXQgPSB3aWR0aC50b0xvd2VyQ2FzZSgpOwogICAgICAgIGlmIChwYWdlRm9ybWF0cy5oYXNPd25Qcm9wZXJ0eShmb3JtYXQpKSB7CiAgICAgICAgICB3aWR0aCA9IHBhZ2VGb3JtYXRzW2Zvcm1hdF1bMF0gLyBrOwogICAgICAgICAgaGVpZ2h0ID0gcGFnZUZvcm1hdHNbZm9ybWF0XVsxXSAvIGs7CiAgICAgICAgfQogICAgICB9CiAgICAgIGlmIChBcnJheS5pc0FycmF5KHdpZHRoKSkgewogICAgICAgIGhlaWdodCA9IHdpZHRoWzFdOwogICAgICAgIHdpZHRoID0gd2lkdGhbMF07CiAgICAgIH0KICAgICAgaWYgKG9yaWVudGF0aW9uKSB7CiAgICAgICAgc3dpdGNoIChvcmllbnRhdGlvbi5zdWJzdHIoMCwgMSkpIHsKICAgICAgICAgIGNhc2UgJ2wnOgogICAgICAgICAgICBpZiAoaGVpZ2h0ID4gd2lkdGgpIG9yaWVudGF0aW9uID0gJ3MnOwogICAgICAgICAgICBicmVhazsKICAgICAgICAgIGNhc2UgJ3AnOgogICAgICAgICAgICBpZiAod2lkdGggPiBoZWlnaHQpIG9yaWVudGF0aW9uID0gJ3MnOwogICAgICAgICAgICBicmVhazsKICAgICAgICB9CiAgICAgICAgaWYgKG9yaWVudGF0aW9uID09PSAncycpIHsKICAgICAgICAgIHRtcCA9IHdpZHRoOwogICAgICAgICAgd2lkdGggPSBoZWlnaHQ7CiAgICAgICAgICBoZWlnaHQgPSB0bXA7CiAgICAgICAgfQogICAgICB9CiAgICAgIG91dFRvUGFnZXMgPSB0cnVlOwogICAgICBwYWdlc1srK3BhZ2VdID0gW107CiAgICAgIHBhZ2VkaW1bcGFnZV0gPSB7CiAgICAgICAgd2lkdGg6IE51bWJlcih3aWR0aCkgfHwgcGFnZVdpZHRoLAogICAgICAgIGhlaWdodDogTnVtYmVyKGhlaWdodCkgfHwgcGFnZUhlaWdodAogICAgICB9OwogICAgICBwYWdlc0NvbnRleHRbcGFnZV0gPSB7fTsKICAgICAgX3NldFBhZ2UocGFnZSk7CiAgICB9LAogICAgICAgIF9hZGRQYWdlID0gZnVuY3Rpb24gX2FkZFBhZ2UoKSB7CiAgICAgIGJlZ2luUGFnZS5hcHBseSh0aGlzLCBhcmd1bWVudHMpOwogICAgICAvLyBTZXQgbGluZSB3aWR0aAogICAgICBvdXQoZjIobGluZVdpZHRoICogaykgKyAnIHcnKTsKICAgICAgLy8gU2V0IGRyYXcgY29sb3IKICAgICAgb3V0KGRyYXdDb2xvcik7CiAgICAgIC8vIHJlc3VycmVjdGluZyBub24tZGVmYXVsdCBsaW5lIGNhcHMsIGpvaW5zCiAgICAgIGlmIChsaW5lQ2FwSUQgIT09IDApIHsKICAgICAgICBvdXQobGluZUNhcElEICsgJyBKJyk7CiAgICAgIH0KICAgICAgaWYgKGxpbmVKb2luSUQgIT09IDApIHsKICAgICAgICBvdXQobGluZUpvaW5JRCArICcgaicpOwogICAgICB9CiAgICAgIGV2ZW50cy5wdWJsaXNoKCdhZGRQYWdlJywgewogICAgICAgIHBhZ2VOdW1iZXI6IHBhZ2UKICAgICAgfSk7CiAgICB9LAogICAgICAgIF9kZWxldGVQYWdlID0gZnVuY3Rpb24gX2RlbGV0ZVBhZ2UobikgewogICAgICBpZiAobiA+IDAgJiYgbiA8PSBwYWdlKSB7CiAgICAgICAgcGFnZXMuc3BsaWNlKG4sIDEpOwogICAgICAgIHBhZ2VkaW0uc3BsaWNlKG4sIDEpOwogICAgICAgIHBhZ2UtLTsKICAgICAgICBpZiAoY3VycmVudFBhZ2UgPiBwYWdlKSB7CiAgICAgICAgICBjdXJyZW50UGFnZSA9IHBhZ2U7CiAgICAgICAgfQogICAgICAgIHRoaX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U3R5bGUpIHsKICAgICAgdmFyIGtleTsKCiAgICAgIGZvbnROYW1lID0gZm9udE5hbWUgIT09IHVuZGVmaW5lZCA/IGZvbnROYW1lIDogZm9udHNbYWN0aXZlRm9udEtleV0uZm9udE5hbWU7CiAgICAgIGZvbnRTdHlsZSA9IGZvbnRTdHlsZSAhPT0gdW5kZWZpbmVkID8gZm9udFN0eWxlIDogZm9udHNbYWN0aXZlRm9udEtleV0uZm9udFN0eWxlOwoKICAgICAgaWYgKGZvbnROYW1lICE9PSB1bmRlZmluZWQpIHsKICAgICAgICBmb250TmFtZSA9IGZvbnROYW1lLnRvTG93ZXJDYXNlKCk7CiAgICAgIH0KICAgICAgc3dpdGNoIChmb250TmFtZSkgewogICAgICAgIGNhc2UgJ3NhbnMtc2VyaWYnOgogICAgICAgIGNhc2UgJ3ZlcmRhbmEnOgogICAgICAgIGNhc2UgJ2FyaWFsJzoKICAgICAgICBjYXNlICdoZWx2ZXRpY2EnOgogICAgICAgICAgZm9udE5hbWUgPSAnaGVsdmV0aWNhJzsKICAgICAgICAgIGJyZWFrOwogICAgICAgIGNhc2UgJ2ZpeGVkJzoKICAgICAgICBjYXNlICdtb25vc3BhY2UnOgogICAgICAgIGNhc2UgJ3Rlcm1pbmFsJzoKICAgICAgICBjYXNlICdjb3VyaWVyJzoKICAgICAgICAgIGZvbnROYW1lID0gJ2NvdXJpZXInOwogICAgICAgICAgYnJlYWs7CiAgICAgICAgY2FzZSAnc2VyaWYnOgogICAgICAgIGNhc2UgJ2N1cnNpdmUnOgogICAgICAgIGNhc2UgJ2ZhbnRhc3knOgogICAgICAgIGRlZmF1bHQ6CiAgICAgICAgICBmb250TmFtZSA9ICd0aW1lcyc7CiAgICAgICAgICBicmVhazsKICAgICAgfQoKICAgICAgdHJ5IHsKICAgICAgICAvLyBnZXQgYSBzdHJpbmcgbGlrZSAnRjMnIC0gdGhlIEtFWSBjb3JyZXNwb25kaW5nIHRvdCBoZSBmb250ICsgdHlwZSBjb21iaW5hdGlvbi4KICAgICAgICBrZXkgPSBmb250bWFwW2ZvbnROYW1lXVtmb250U3R5bGVdOwogICAgICB9IGNhdGNoIChlKSB7fQoKICAgICAgaWYgKCFrZXkpIHsKICAgICAgICAvL3Rocm93IG5ldyBFcnJvcigiVW5hYmxlIHRvIGxvb2sgdXAgZm9udCBsYWJlbCBmb3IgZm9udCAnIiArIGZvbnROYW1lICsgIicsICciCiAgICAgICAgLy8rIGZvbnRTdHlsZSArICInLiBSZWZlciB0byBnZXRGb250TGlzdCgpIGZvciBhdmFpbGFibGUgZm9udHMuIik7CiAgICAgICAga2V5ID0gZm9udG1hcFsndGltZXMnXVtmb250U3R5bGVdOwogICAgICAgIGlmIChrZXkgPT0gbnVsbCkgewogICAgICAgICAga2V5ID0gZm9udG1hcFsndGltZXMnXVsnbm9ybWFsJ107CiAgICAgICAgfQogICAgICB9CiAgICAgIHJldHVybiBrZXk7CiAgICB9LAogICAgICAgIGJ1aWxkRG9jdW1lbnQgPSBmdW5jdGlvbiBidWlsZERvY3VtZW50KCkgewogICAgICBvdXRUb1BhZ2VzID0gZmFsc2U7IC8vIHN3aXRjaGVzIG91dCgpIHRvIGNvbnRlbnQKCiAgICAgIG9iamVjdE51bWJlciA9IDI7CiAgICAgIGNvbnRlbnRfbGVuZ3RoID0gMDsKICAgICAgY29udGVudCA9IFtdOwogICAgICBvZmZzZXRzID0gW107CiAgICAgIGFkZGl0aW9uYWxPYmplY3RzID0gW107CiAgICAgIC8vIEFkZGVkIGZvciBBY3JvRm9ybQogICAgICBldmVudHMucHVibGlzaCgnYnVpbGREb2N1bWVudCcpOwoKICAgICAgLy8gcHV0SGVhZGVyKCkKICAgICAgb3V0KCclUERGLScgKyBwZGZWZXJzaW9uKTsKCiAgICAgIHB1dFBhZ2VzKCk7CgogICAgICAvLyBNdXN0IGhhcHBlbiBhZnRlciBwdXRQYWdlcwogICAgICAvLyBNb2RpZmllcyBjdXJyZW50IG9iamVjdCBJZAogICAgICBwdXRBZGRpdGlvbmFsT2JqZWN0cygpOwoKICAgICAgcHV0UmVzb3VyY2VzKCk7CgogICAgICAvLyBJbmZvCiAgICAgIG5ld09iamVjdCgpOwogICAgICBvdXQoJzw8Jyk7CiAgICAgIHB1dEluZm8oKTsKICAgICAgb3V0KCc+PicpOwogICAgICBvdXQoJ2VuZG9iaicpOwoKICAgICAgLy8gQ2F0YWxvZwogICAgICBuZXdPYmplY3QoKTsKICAgICAgb3V0KCc8PCcpOwogICAgICBwdXRDYXRhbG9nKCk7CiAgICAgIG91dCgnPj4nKTsKICAgICAgb3V0KCdlbmRvYmonKTsKCiAgICAgIC8vIENyb3NzLXJlZgogICAgICB2YXIgbyA9IGNvbnRlbnRfbGVuZ3RoLAogICAgICAgICAgaSwKICAgICAgICAgIHAgPSAiMDAwMDAwMDAwMCI7CiAgICAgIG91dCgneHJlZicpOwogICAgICBvdXQoJzAgJyArIChvYmplY3ROdW1iZXIgKyAxKSk7CiAgICAgIG91dChwICsgJyA2NTUzNSBmICcpOwogICAgICBmb3IgKGkgPSAxOyBpIDw9IG9iamVjdE51bWJlcjsgaSsrKSB7CiAgICAgICAgdmFyIG9mZnNldCA9IG9mZnNldHNbaV07CiAgICAgICAgaWYgKHR5cGVvZiBvZmZzZXQgPT09ICdmdW5jdGlvbicpIHsKICAgICAgICAgIG91dCgocCArIG9mZnNldHNbaV0oKSkuc2xpY2UoLTEwKSArICcgMDAwMDAgbiAnKTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgb3V0KChwICsgb2Zmc2V0c1tpXSkuc2xpY2UoLTEwKSArICcgMDAwMDAgbiAnKTsKICAgICAgICB9CiAgICAgIH0KICAgICAgLy8gVHJhaWxlcgogICAgICBvdXQoJ3RyYWlsZXInKTsKICAgICAgb3V0KCc8PCcpOwogICAgICBwdXRUcmFpbGVyKCk7CiAgICAgIG91dCgnPj4nKTsKICAgICAgb3V0KCdzdGFydHhyZWYnKTsKICAgICAgb3V0KCcnICsgbyk7CiAgICAgIG91dCgnJSVFT0YnKTsKCiAgICAgIG91dFRvUGFnZXMgPSB0cnVlOwoKICAgICAgcmV0dXJuIGNvbnRlbnQuam9pbignXG4nKTsKICAgIH0sCiAgICAgICAgZ2V0U3R5bGUgPSBmdW5jdGlvbiBnZXRTdHlsZShzdHlsZSkgewogICAgICAvLyBzZWUgcGF0aC1wYWludGluZyBvcGVyYXRvcnMgaW4gUERGIHNwZWMKICAgICAgdmFyIG9wID0gJ1MnOyAvLyBzdHJva2UKICAgICAgaWYgKHN0eWxlID09PSAnRicpIHsKICAgICAgICBvcCA9ICdmJzsgLy8gZmlsbAogICAgICB9IGVsc2UgaWYgKHN0eWxlID09PSAnRkQnIHx8IHN0eWxlID09PSAnREYnKSB7CiAgICAgICAgb3AgPSAnQic7IC8vIGJvdGgKICAgICAgfSBlbHNlIGlmIChzdHlsZSA9PT0gJ2YnIHx8IHN0eWxlID09PSAnZionIHx8IHN0eWxlID09PSAnQicgfHwgc3R5bGUgPT09ICdCKicpIHsKICAgICAgICAvKgogICAgICAgICBBbGxvdyBkaXJlY3QgdXNlIG9mIHRoZXNlIFBERiBwYXRoLXBhaW50aW5nIG9wZXJhdG9yczoKICAgICAgICAgLSBmCWZpbGwgdXNpbmcgbm9uemVybyB3aW5kaW5nIG51bWJlciBydWxlCiAgICAgICAgIC0gZioJZmlsbCB1c2luZyBldmVuLW9kZCBydWxlCiAgICAgICAgIC0gQglmaWxsIHRoZW4gc3Ryb2tlIHdpdGggZmlsbCB1c2luZyBub24temVybyB3aW5kaW5nIG51bWJlciBydWxlCiAgICAgICAgIC0gQioJZmlsbCB0aGVuIHN0cm9rZSB3aXRoIGZpbGwgdXNpbmcgZXZlbi1vZGQgcnVsZQogICAgICAgICAqLwogICAgICAgIG9wID0gc3R5bGU7CiAgICAgIH0KICAgICAgcmV0dXJuIG9wOwogICAgfSwKICAgICAgICBnZXRBcnJheUJ1ZmZlciA9IGZ1bmN0aW9uIGdldEFycmF5QnVmZmVyKCkgewogICAgICB2YXIgZGF0YSA9I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KyB0eXBlKS5zdWJzdHIoMCwgNikgPT09ICdkYXRhdXInID8gJ2RhdGE6YXBwbGljYXRpb24vcGRmO2Jhc2U2NCwnICsgYnRvYShidWlsZERvY3VtZW50KCkpIDogMDsKCiAgICAgIHN3aXRjaCAodHlwZSkgewogICAgICAgIGNhc2UgdW5kZWZpbmVkOgogICAgICAgICAgcmV0dXJuIGJ1aWxkRG9jdW1lbnQoKTsKICAgICAgICBjYXNlICdzYXZlJzoKICAgICAgICAgIGlmIChuYXZpZ2F0b3IuZ2V0VXNlck1lZGlhKSB7CiAgICAgICAgICAgIGlmIChnbG9iYWwuVVJMID09PSB1bmRlZmluZWQgfHwgZ2xvYmFsLlVSTC5jcmVhdGVPYmplY3RVUkwgPT09IHVuZGVmaW5lZCkgewogICAgICAgICAgICAgIHJldHVybiBBUEkub3V0cHV0KCdkYXRhdXJsbmV3d2luZG93Jyk7CiAgICAgICAgICAgIH0KICAgICAgICAgIH0KICAgICAgICAgIHNhdmVBcyhnZXRCbG9iKCksIG9wdGlvbnMpOwogICAgICAgICAgaWYgKHR5cGVvZiBzYXZlQXMudW5sb2FkID09PSAnZnVuY3Rpb24nKSB7CiAgICAgICAgICAgIGlmIChnbG9iYWwuc2V0VGltZW91dCkgewogICAgICAgICAgICAgIHNldFRpbWVvdXQoc2F2ZUFzLnVubG9hZCwgOTExKTsKICAgICAgICAgICAgfQogICAgICAgICAgfQogICAgICAgICAgYnJlYWs7CiAgICAgICAgY2FzZSAnYXJyYXlidWZmZXInOgogICAgICAgICAgcmV0dXJuIGdldEFycmF5QnVmZmVyKCk7CiAgICAgICAgY2FzZSAnYmxvYic6CiAgICAgICAgICByZXR1cm4gZ2V0QmxvYigpOwogICAgICAgIGNhc2UgJ2Jsb2J1cmknOgogICAgICAgIGNhc2UgJ2Jsb2J1cmwnOgogICAgICAgICAgLy8gVXNlciBpcyByZXNwb25zaWJsZSBvZiBjYWxsaW5nIHJldm9rZU9iamVjdFVSTAogICAgICAgICAgcmV0dXJuIGdsb2JhbC5VUkwgJiYgZ2xvYmFsLlVSTC5jcmVhdGVPYmplY3RVUkwoZ2V0QmxvYigpKSB8fCB2b2lkIDA7CiAgICAgICAgY2FzZSAnZGF0YXVyaXN0cmluZyc6CiAgICAgICAgY2FzZSAnZGF0YXVybHN0cmluZyc6CiAgICAgICAgICByZXR1cm4gZGF0YXVyaTsKICAgICAgICBjYXNlICdkYXRhdXJsbmV3d2luZG93JzoKICAgICAgICAgIHZhciBuVyA9IGdsb2JhbC5vcGVuKGRhdGF1cmkpOwogICAgICAgICAgaWYgKG5XIHx8IHR5cGVvZiBzYWZhcmkgPT09ICJ1bmRlZmluZWQiKSByZXR1cm4gblc7CiAgICAgICAgLyogcGFzcyB0aHJvdWdoICovCiAgICAgICAgY2FzZSAnZGF0YXVyaSc6CiAgICAgICAgY2FzZSAnZGF0YXVybCc6CiAgICAgICAgICByZXR1cm4gZ2xvYmFsLmRvY3VtZW50LmxvY2F0aW9uLmhyZWYgPSBkYXRhdXJpOwogICAgICAgIGRlZmF1bHQ6CiAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ091dHB1dCB0eXBlICInICsgdHlwZSArICciIGlzIG5vdCBzdXBwb3J0ZWQuJyk7CiAgICAgIH0KICAgICAgLy8gQFRPRE86IEFkZCBkaWZmZXJlbnQgb3V0cHV0IG9wdGlvbnMKICAgIH0pOwoKICAgIHN3aXRjaCAodW5pdCkgewogICAgICBjYXNlICdwdCc6CiAgICAgICAgayA9IDE7CiAgICAgICAgYnJlYWs7CiAgICAgIGNhc2UgJ21tJzoKICAgICAgICBrID0gNzIgLyAyNS40MDAwNTA4OwogICAgICAgIGJyZWFrOwogICAgICBjYXNlICdjbSc6CiAgICAgICAgayA9IDcyIC8gMi41NDAwMDUwODsKICAgICAgICBicmVhazsKICAgICAgY2FzZSAnaW4nOgogICAgICAgIGsgPSA3MjsKICAgICAgICBicmVhazsKICAgICAgY2FzZSAncHgnOgogICAgICAgIGsgPSA5NiAvIDcyOwogICAgICAgIGJyZWFrOwogICAgICBjYXNlICdwYyc6CiAgICAgICAgayA9IDEyOwogICAgICAgIGJyZWFrOwogICAgICBjYXNlICdlbSc6CiAgICAgICAgayA9IDEyOwogICAgICAgIGJyZWFrOwogICAgICBjYXNlICdleCc6CiAgICAgICAgayA9IDY7CiAgICAgICAgYnJlYWs7CiAgICAgIGRlZmF1bHQ6CiAgICAgICAgdGhyb3cgJ0ludmFsaWQgdW5pdDogJyArIHVuaXQ7CiAgICB9CgogICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KICAgIC8vIFB1YmxpYyBBUEkKCiAgICAvKioKICAgICAqIE9iamVjdCBleHBvc2luZyBpbnRlcm5hbCBBUEkgdG8gcGx1Z2lucwogICAgICogQHB1YmxpYwogICAgICovCiAgICBBUEkuaW50ZXJuYWwgPSB7CiAgICAgICdwZGZFc2NhcGUnOiBwZGZFc2NhcGUsCiAgICAgICdnZXRTdHlsZSc6IGdldFN0eWxlLAogICAgICAvKioKICAgICAgICogUmV0dXJucyB7Rm9udE9iamVjdH0gZGVzY3JpYmluZyBhIHBhcnRpY3VsYXIgZm9udC4KICAgICAgICogQHB1YmxpYwogICAgICAgKiBAZnVuY3Rpb24KICAgICAgICogQHBhcmFtIGZvbnROYW1lIHtTdHJpbmd9IChPcHRpb25hbCkgRm9udCdzIGZhbWlseSBuYW1lCiAgICAgICAqIEBwYXJhbSBmb250U3R5bGUge1N0cmluZ30gKE9wdGlvbmFsKSBGb250J3Mgc3R5bGUgdmFyaWF0aW9uIG5hbWUgKEV4YW1wbGU6Ikl0YWxpYyIpCiAgICAgICAqIEByZXR1cm5zIHtGb250T2JqZWN0fQogICAgICAgKi8KICAgICAgJ2dldEZvbnQnOiBmdW5jdGlvbiBnZXRGb250KCkgewogICAgICAgIHJldHVybiBmb250c1tfZ2V0Rm9udC5hcHBseShBUEksIGFyZ3VtZW50cyldOwogICAgICB9LAogICAgICAnZ2V0Rm9udFNp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ZjInOiBmMiwKICAgICAgJ2dldFBhZ2VJbmZvJzogZnVuY3Rpb24gZ2V0UGFnZUluZm8ocGFnZU51bWJlck9uZUJhc2VkKSB7CiAgICAgICAgdmFyIG9iaklkID0gKHBhZ2VOdW1iZXJPbmVCYXNlZCAtIDEpICogMiArIDM7CiAgICAgICAgcmV0dXJuIHsKICAgICAgICAgIG9iaklkOiBvYmpJZCwKICAgICAgICAgIHBhZ2VOdW1iZXI6IHBhZ2VOdW1iZXJPbmVCYXNlZCwKICAgICAgICAgIHBhZ2VDb250ZXh0OiBwYWdlc0NvbnRleHRbcGFnZU51bWJlck9uZUJhc2VkXQogICAgICAgIH07CiAgICAgIH0sCiAgICAgICdnZXRDdXJyZW50UGFnZUluZm8nOiBmdW5jdGlvbiBnZXRDdXJyZW50UGFnZUluZm8oKSB7CiAgICAgICAgdmFyIG9iaklkID0gKGN1cnJlbnRQYWdlIC0gMSkgKiAyICsgMzsKICAgICAgICByZXR1cm4gewogICAgICAgICAgb2JqSWQ6IG9iaklkLAogICAgICAgICAgcGFnZU51bWJlcjogY3VycmVudFBhZ2UsCiAgICAgICAgICBwYWdlQ29udGV4dDogcGFnZXNDb250ZXh0W2N1cnJlbnRQYWdlXQogICAgICAgIH07CiAgICAgIH0sCiAgICAgICdnZXRQREZWZXJzaW9uJzogZnVuY3Rpb24gZ2V0UERGVmVyc2lvbigpIHsKICAgICAgICByZXR1cm4gcGRmVmVyc2lvbjsKICAgICAgfQogICAgfTsKCiAgICAvKioKICAgICAqIEFkZHMgKGFuZCB0cmFuc2ZlcnMgdGhlIGZvY3VzIHRvKSBuZXcgcGFnZSB0byB0aGUgUERGIGRvY3VtZW50LgogICAgICogQGZ1bmN0aW9uCiAgICAgKiBAcmV0dXJucyB7anNQREZ9CiAgICAgKgogICAgICogQG1ldGhvZE9mIGpzUERGIwogICAgICogQG5hbWUgYWRkUGFnZQogICAgICovCiAgICBBUEkuYWRkUGFnZSA9IGZ1bmN0aW9uICgpIHsKICAgICAgX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LyB3ZSBhc3N1bWUgdGhlIHVzZXIga25vd3Mgd2hhdCB0aGV5IGFyZSBkb2luZy4KICAgICAgLy8gQ29udmVydCB0ZXh0IGludG8gYW4gYXJyYXkgYW55d2F5IHRvIHNpbXBsaWZ5CiAgICAgIC8vIGxhdGVyIGNvZGUuCiAgICAgIGlmICh0eXBlb2YgdGV4dCA9PT0gJ3N0cmluZycpIHsKICAgICAgICBpZiAodGV4dC5tYXRjaCgvW1xuXHJdLykpIHsKICAgICAgICAgIHRleHQgPSB0ZXh0LnNwbGl0KC9cclxufFxyfFxuL2cpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICB0ZXh0ID0gW3RleHRdOwogICAgICAgIH0KICAgICAgfQogICAgICBpZiAodHlwZW9mIGFuZ2xlID09PSAnc3RyaW5nJykgewogICAgICAgIGFsaWduID0gYW5nbGU7CiAgICAgICAgYW5nbGUgPSBudWxsOwogICAgICB9CiAgICAgIGlmICh0eXBlb2YgZmxhZ3MgPT09ICdzdHJpbmcnKSB7CiAgICAgICAgYWxpZ24gPSBmbGFnczsKICAgICAgICBmbGFncyA9IG51bGw7CiAgICAgIH0KICAgICAgaWYgKHR5cGVvZiBmbGFncyA9PT0gJ251bWJlcicpIHsKICAgICAgICBhbmdsZSA9IGZsYWdzOwogICAgICAgIGZsYWdzID0gbnVsbDsKICAgICAgfQogICAgICB2YXIgeHRyYSA9ICcnLAogICAgICAgICAgbW9kZSA9ICdUZCcsCiAgICAgICAgICB0b2RvOwogICAgICBpZiAoYW5nbGUpIHsKICAgICAgICBhbmdsZSAqPSBNYXRoLlBJIC8gMTgwOwogICAgICAgIHZhciBjID0gTWF0aC5jb3MoYW5nbGUpLAogICAgICAgICAgICBzID0gTWF0aC5zaW4oYW5nbGUpOwogICAgICAgIHh0cmEgPSBbZjIoYyksIGYyKHMpLCBmMihzICogLTEpLCBmMihjKSwgJyddLmpvaW4oIiAiKTsKICAgICAgICBtb2RlID0gJ1RtJzsKICAgICAgfQogICAgICBmbG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AgICAgICAgIH0sIHRoaXMpOwogICAgICAgICAgbWF4TGluZUxlbmd0aCA9IE1hdGgubWF4LmFwcGx5KE1hdGgsIGxpbmVXaWR0aHMpOwogICAgICAgICAgLy8gVGhlIGZpcnN0IGxpbmUgdXNlcyB0aGUgIm1haW4iIFRkIHNldHRpbmcsCiAgICAgICAgICAvLyBhbmQgdGhlIHN1YnNlcXVlbnQgbGluZXMgYXJlIG9mZnNldCBieSB0aGUKICAgICAgICAgIC8vIHByZXZpb3VzIGxpbmUncyB4IGNvb3JkaW5hdGUuCiAgICAgICAgICBpZiAoYWxpZ24gPT09ICJjZW50ZXIiKSB7CiAgICAgICAgICAgIC8vIFRoZSBwYXNzZWQgaW4geCBjb29yZGluYXRlIGRlZmluZXMKICAgICAgICAgICAgLy8gdGhlIGNlbnRlciBwb2ludC4KICAgICAgICAgICAgbGVmdCA9IHggLSBtYXhMaW5lTGVuZ3RoIC8gMjsKICAgICAgICAgICAgeCAtPSBsaW5lV2lkdGhzWzBdIC8gMjsKICAgICAgICAgIH0gZWxzZSBpZiAoYWxpZ24gPT09ICJyaWdodCIpIHsKICAgICAgICAgICAgLy8gVGhlIHBhc3NlZCBpbiB4IGNvb3JkaW5hdGUgZGVmaW5lcyB0aGUKICAgICAgICAgICAgLy8gcmlnaHRtb3N0IHBvaW50IG9mIHRoZSB0ZXh0LgogICAgICAgICAgICBsZWZ0ID0geCAtIG1heExpbmVMZW5ndGg7CiAgICAgICAgICAgIHggLT0gbGluZVdpZHRoc1swXTsKICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignVW5yZWNvZ25pemVkIGFsaWdubWVudCBvcHRpb24sIHVzZSAiY2VudGVyIiBvciAicmlnaHQiLicpOwogICAgICAgICAgfQogICAgICAgICAgcHJldlggPSB4OwogICAgICAgICAgdGV4dCA9IGRhWzBdOwogICAgICAgICAgZm9yICh2YXIgaSA9IDEsIGxlbiA9IGRhLmxlbmd0aDsgaSA8IGx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ScsIGYyKCh4ICsgcngpICogayksIGYyKChwYWdlSGVpZ2h0IC0gKHkgLSBseSkpICogayksIGYyKCh4ICsgbHgpICogayksIGYyKChwYWdlSGVpZ2h0IC0gKHkgLSByeSkpICogayksIGYyKHggKiBrKSwgZjIoKHBhZ2VIZWlnaHQgLSAoeSAtIHJ5KSkgKiBrKSwgJ2MnXS5qb2luKCcgJykpOwogICAgICBvdXQoW2YyKCh4IC0gbHgpICogayksIGYyKChwYWdlSGVpZ2h0IC0gKHkgLSByeSkpICogayksIGYyKCh4IC0gcngpICogayksIGYyKChwYWdlSGVpZ2h0IC0gKHkgLSBseSkpICogayksIGYyKCh4IC0gcngpICogayksIGYyKChwYWdlSGVpZ2h0IC0geSkgKiBrKSwgJ2MnXS5qb2luKCcgJykpOwogICAgICBvdXQoW2YyKCh4IC0gcngpICogayksIGYyKChwYWdlSGVpZ2h0IC0gKHkgKyBseSkpICogayksIGYyKCh4IC0gbHgpICogayksIGYyKChwYWdlSGVpZ2h0IC0gKHkgKyByeSkpICogayksIGYyKHggKiBrKSwgZjIoKHBhZ2VIZWlnaHQgLSAoeSArIHJ5KSkgKiBrKSwgJ2MnXS5qb2luKCcgJykpOwogICAgICBvdXQoW2YyKCh4ICsgbHgpICogayksIGYyKChwYWdlSGVpZ2h0IC0gKHkgKyByeSkpICogayksIGYyKCh4ICsgcngpICogayksIGYyKChwYWdlSGVpZ2h0IC0gKHkgKyBseSkpICogayksIGYyKCh4ICsgcngpICogayksIGYyKChwYWdlSGVpZ2h0IC0geSkgKiBrKSwgJ2MnXS5qb2luKCcgJykpOwoKICAgICAgaWYgKHN0eWxlICE9PSBudWxsKSB7CiAgICAgICAgb3V0KGdldFN0eWxlKHN0eWxlKSk7CiAgICAgIH0KCiAgICAgIHJldHVybiB0aGlzOwogICAgfTsKCiAgICAvKioKICAgICAqIEFkZHMgYW4gY2lyY2xlIHRvIFBERgogICAgICoKICAgICAqIEBwYXJhbSB7TnVtYmVyfSB4IENvb3JkaW5hdG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BzZSh4LCB5LCByLCByLCBzdHlsZSk7CiAgICB9OwoKICAgIC8qKgogICAgICogQWRkcyBhIHByb3BlcnRpZXMgdG8gdGhlIFBERiBkb2N1bWVudAogICAgICoKICAgICAqIEBwYXJhbSB7T2JqZWN0fSBBIHByb3BlcnR5X25hbWUtdG8tcHJvcGVydHlfdmFsdWUgb2JqZWN0IHN0cnVjdHVyZS4KICAgICAqIEBmdW5jdGlvbgogICAgICogQHJldHVybnMge2pzUERGfQogICAgICogQG1ldGhvZE9mIGpzUERGIwogICAgICogQG5hbWUgc2V0UHJvcGVydGllcwogICAgICovCiAgICBBUEkuc2V0UHJvcGVydGllcyA9IGZ1bmN0aW9uIChwcm9wZXJ0aWVzKSB7CiAgICAgIC8vIGNvcHlpbmcgb25seSB0aG9zZSBwcm9wZXJ0aWVzIHdlIGNhbiByZW5kZXIuCiAgICAgIGZvciAodmFyIHByb3BlcnR5IGluIGRvY3VtZW50UHJvcGVydGllcykgewogICAgICAgIGlmIChkb2N1bWVudFByb3BlcnRpZXMuaGFzT3duUHJvcGVydHkocHJvcGVydHkpICYmIHByb3BlcnRpZXNbcHJvcGVydHldKSB7CiAgICAgICAgICBkb2N1bWVudFByb3BlcnRpZXNbcHJvcGVydHldID0gcHJvcGVydGllc1twcm9wZXJ0eV07CiAgICAgICAgfQogICAgICB9CiAgICAgIHJldHVybiB0aGlzOwogICAgfTsKCiAgICAvKioKICAgICAqIFNldHMgZm9udCBzaXplIGZvciB1cGNvbWluZyB0ZXh0IGVsZW1lbnRzLgogICAgICoKICAgICAqIEBwYXJhbSB7TnVtYmVyfSBzaXplIEZvbnQgc2l6ZSBpbiBwb2ludHMuCiAgICAgKiBAZnVuY3Rpb24KICAgICAqIEByZXR1cm5zIHtqc1BERn0KICAgICAqIEBtZXRob2RPZiBqc1BERiMKICAgICAqIEBuYW1lIHNldEZvbnRTaXplCiAgICAgKi8KICAgIEFQSS5zZXRGb250U2l6ZSA9IGZ1bmN0aW9uIChzaXplKSB7CiA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cCBpbnN0ZWFkIGluIGNhc2UgbW9yZSBhcmUgZXZlciBhZGRlZC4KICAgICAgdmFyIGxpc3QgPSB7fSwKICAgICAgICAgIGZvbnROYW1lLAogICAgICAgICAgZm9udFN0eWxlLAogICAgICAgICAgdG1wOwoKICAgICAgZm9yIChmb250TmFtZSBpbiBmb250bWFwKSB7CiAgICAgICAgaWYgKGZvbnRtYXAuaGFzT3duUHJvcGVydHkoZm9udE5hbWUpKSB7CiAgICAgICAgICBsaXN0W2ZvbnROYW1lXSA9IHRtcCA9IFtdOwogICAgICAgICAgZm9yIChmb250U3R5bGUgaW4gZm9udG1hcFtmb250TmFtZV0pIHsKICAgICAgICAgICAgaWYgKGZvbnRtYXBbZm9udE5hbWVdLmhhc093blByb3BlcnR5KGZvbnRTdHlsZSkpIHsKICAgICAgICAgICAgICB0bXAucHVzaChmb250U3R5bGUpOwogICAgICAgICAgICB9CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9CgogICAgICByZXR1cm4gbGlzdDsKICAgIH07CgogICAgLyoqCiAgICAgKiBBZGQgYSBjdXN0b20gZm9udC4KICAgICAqCiAgICAgKiBAcGFyYW0ge1N0cmluZ30gUG9zdHNjcmlwdCBuYW1lIG9mIHRoZSBGb250LiAgRXhhbXBsZTogIk1lbmxvLVJlZ3VsYXIiCiAgICAgKiBAcGFyYW0ge1N0cmluZ30gTmFtZSBvZiBmb250LWZhbWlseSBmcm9tIEBmb250LWZhY2UgZGVmaW5pdGlvbi4gIEV4YW1wbGU6ICJNZW5sbyBSZWd1bGFyIgogICAgICogQHBhcmFtIHtTdHJpbmd9IEZvbnQgc3R5bGUuICBFeGFtcGxlOiAibm9ybWFsIgogICAgICogQGZ1bmN0aW9uCiAgICAgKiBAcmV0dXJucyB0aGUge2ZvbnRLZXl9IChzYW1lIGFzIHRoZSBpbnRlcm5hbCBtZXRob2QpCiAgICAgKiBAbWV0aG9kT2YganNQREYjCiAgICAgKiBAbmFtZSBhZGRGb250CiAgICAgKi8KIC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ZSB7CiAgICAgICAgICBjb2xvciA9IGYyKGNoMSAvIDI1NSkgKyAnIGcnOwogICAgICAgIH0KICAgICAgfSBlbHNlIGlmIChjaDQgPT09IHVuZGVmaW5lZCB8fCAodHlwZW9mIGNoNCA9PT0gJ3VuZGVmaW5lZCcgPyAndW5kZWZpbmVkJyA6IF90eXBlb2YoY2g0KSkgPT09ICdvYmplY3QnKSB7CiAgICAgICAgLy8gUkdCCiAgICAgICAgaWYgKHR5cGVvZiBjaDEgPT09ICdzdHJpbmcnKSB7CiAgICAgICAgICBjb2xvciA9IFtjaDEsIGNoMiwgY2gzLCAncmcnXS5qb2luKCcgJyk7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgIGNvbG9yID0gW2YyKGNoMSAvIDI1NSksIGYyKGNoMiAvIDI1NSksIGYyKGNoMyAvIDI1NSksICdyZyddLmpvaW4oJyAnKTsKICAgICAgICB9CiAgICAgICAgaWYgKGNoNCAmJiBjaDQuYSA9PT0gMCkgewogICAgICAgICAgLy9UT0RPIEltcGxlbWVudCB0cmFuc3BhcmVuY3kuCiAgICAgICAgICAvL1dPUktBUk9VTkQgdXNlIHdoaXRlIGZvciBub3cKICAgICAgICAgIGNvbG9yID0gWycyNTUnLCAnMjU1JywgJzI1NScsICdyZyddLmpvaW4oJyAnKTsKICAgICAgICB9CiAgICAgIH0gZWxzZSB7CiAgICAgICAgLy8gQ01ZSwogICAgICAgIGlmICh0eXBlb2YgY2gxID09PSAnc3RyaW5nJykgewogICAgICAgICAgY29sb3IgPSBbY2gxLCBjaDIsIGNoMywgY2g0LCAnayddLmpvaW4oJyAnKTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgY29sb3IgPSBbZjIoY2gxKSwgZjIoY2gyKSwgZjIoY2gzKSwgZjIoY2g0KSwgJ2snXS5qb2luKCcgJyk7CiAgICAgICAgfQogICAgICB9CgogICAgICBvdXQoY29sb3IpOwogICAgICByZXR1cm4gdGhpczsKICAgIH07CgogICAgLyoqCiAgICAgKi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b2xvciA9IGYzKHIgLyAyNTUpICsgJyBnJzsKICAgICAgfSBlbHNlIHsKICAgICAgICB0ZXh0Q29sb3IgPSBbZjMociAvIDI1NSksIGYzKGcgLyAyNTUpLCBmMyhiIC8gMjU1KSwgJ3JnJ10uam9pbignICcpOwogICAgICB9CiAgICAgIHJldHVybiB0aGlzOwogICAgfTsKCiAgICAvKioKICAgICAqIElzIGFuIE9iamVjdCBwcm92aWRpbmcgYSBtYXBwaW5nIGZyb20gaHVtYW4tcmVhZGFibGUgdG8KICAgICAqIGludGVnZXIgZmxhZyB2YWx1ZXMgZGVzaWduYXRpbmcgdGhlIHZhcmlldGllcyBvZiBsaW5lIGNhcAogICAgICogYW5kIGpvaW4gc3R5bGVzLgogICAgICoKICAgICAqIEByZXR1cm5zIHtPYmplY3R9CiAgICAgKiBAZmllbGRPZiBqc1BERiMKICAgICAqIEBuYW1lIENhcEpvaW5TdHlsZXMKICAgICAqLwogICAgQVBJLkNhcEpvaW5TdHlsZXMgPSB7CiAgICAgIDA6IDAsCiAgICAgICdidXR0JzogMCwKICAgICAgJ2J1dCc6IDAsCiAgICAgICdtaXRlcic6IDAsCiAgICAgIDE6IDEsCiAgICAgICdyb3VuZCc6IDEsCiAgICAgICdyb3VuZGVkJzogMSwKICAgICAgJ2NpcmNsZSc6IDEsCiAgICAgIDI6IDIsCiAgICAgICdwcm9qZWN0aW5nJzogMiwKICAgICAgJ3Byb2plY3QnOiAyLAogICAgICAnc3F1YXJlJzogMiwKICAgICAgJ2JldmVsJzogMgogICAgfTsKCiAgICAvKioKICAgICAqIFNldHMgdGhlIGxpbmUgY2FwIHN0eWxlcwogICAgICogU2VlIHtqc1BERi5DYXBKb2luU3R5bGVzfSBmb3IgdmFyaWFudHMKICAgICAqCiAgICAgKiBAcGFyYW0ge1N0cmluZ3xOdW1iZXJ9IHN0eWxlIEEgc3RyaW5nIG9yIG51bWJlciBpZGVudGlmeWluZyB0aGUgdHlwZSBvZiBsaW5lIGNhcAogICAgICogQ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gaTsKICAgICAgICAgICAgdmFyIGZvcm0gPSBmaWVsZEFycmF5W2ldOwoKICAgICAgICAgICAgdmFyIG9sZFJlY3QgPSBmb3JtLlJlY3Q7CgogICAgICAgICAgICBpZiAoZm9ybS5SZWN0KSB7CiAgICAgICAgICAgICAgICBmb3JtLlJlY3QgPSBBY3JvRm9ybS5pbnRlcm5hbC5jYWxjdWxhdGVDb29yZGluYXRlcy5jYWxsKHRoaXMsIGZvcm0uUmVjdCk7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIC8vIFN0YXJ0IFdyaXRpbmcgdGhlIE9iamVjdAogICAgICAgICAgICB0aGlzLmludGVybmFsLm5ld09iamVjdERlZmVycmVkQmVnaW4oZm9ybS5vYmpJZCk7CgogICAgICAgICAgICB2YXIgY29udGVudCA9ICIiOwogICAgICAgICAgICBjb250ZW50ICs9IGZvcm0ub2JqSWQgKyAiIDAgb2JqXG4iOwoKICAgICAgICAgICAgY29udGVudCArPSAiPDxcbiIgKyBmb3JtLmdldENvbnRlbnQoKTsKCiAgICAgICAgICAgIGZvcm0uUmVjdCA9IG9sZFJlY3Q7CgogICAgICAgICAgICBpZiAoZm9ybS5oYXNBcHBlYXJhbmNlU3RyZWFtICYmICFmb3JtLmFwcGVhcmFuY2VTdHJlYW1Db250ZW50KSB7CiAgICAgICAgICAgICAgICAvLyBDYWxjdWxhdGUgQXBwZWFyYW5jZQogICAgICAgICAgICAgICAgdmFyIGFwcGVhcmFuY2UgPSBBY3JvRm9ybS5pbnRlcm5hbC5jYWxjdWxhdGVBcHBlYXJhbmNlU3RyZWFtLmNhbGwodGhpcywgZm9ybSk7CiAgICAgICAgICAgICAgICBjb250ZW50ICs9ICIvQVAgPDwgL04gIiArIGFwcGVhcmFuY2UgKyAiID4+XG4iOwoKICAgICAgICAgICAgICAgIHRoaXMuYWNyb2Zvcm1QbHVnaW4ueEZvcm1zLnB1c2goYXBwZWFyYW5jZSk7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIC8vIEFzc3VtZSBBcHBlYXJhbmNlU3RyZWFtQ29udGVudCBpcyBhIEFycmF5IHdpdGggTixSLEQgKGF0IGxlYXN0IG9uZSBvZiB0aGVtISkKICAgICAgICAgICAgaWYgKGZvcm0uYXBwZWFyYW5jZVN0cmVhbUNvbnRlbnQpIHsKICAgICAgICAgICAgICAgIGNvbnRlbnQgKz0gIi9BUCA8PCAiOwogICAgICAgICAgICAgICAgLy8gSXRlcmF0ZSBvdmVyIE4sUiBhbmQgRAogICAgICAgICAgICAgICAgZm9yICh2YXIgayBpbiBmb3JtLmFwcGVhcmFuY2VTdHJlYW1Db250ZW50KSB7CiAgICAgICAgICAgICAgICAgICAgdmFyIHZhbHVlID0gZm9ybS5hcHBlYXJhbmNlU3RyZWFtQ29udGVudFtrXTsKICAgICAgICAgICAgICAgICAgICBjb250ZW50ICs9ICIvIiArIGsgKyAiICI7CiAgICAgICAgICAgICAgICAgICAgY29udGVudCArPSAiPDwgIjsKICAgICAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXModmFsdWUpLmxlbmd0aCA+PSAxIHx8IEFycmF5LmlzQXJyYXkodmFsdWUpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGFwcGVhcmFuY2VTdHJlYW0gaXMgYW4gQXJyYXkgb3IgT2JqZWN0IQogICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpIGluIHZhbHVlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgb2JqID0gdmFsdWVbaV07CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIG9iaiA9PT0gJ2Z1bmN0aW9uJykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGlmIEZ1bmN0aW9uIGlzIHJlZmVyZW5jZWQsIGNhbGwgaXQgaW4gb3JkZXIgdG8gZ2V0IHRoZSBGb3JtWE9iamVjdAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9iaiA9IG9iai5jYWxsKHRoaXMsIGZvcm0pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudCArPSAiLyIgKyBpICsgIiAiICsgb2JqICsgIiAiOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEluIGNhc2UgdGhlIFhGb3JtIGlzIGFscmVhZHkgdXNlZCwgZS5nLiBPZmZTdGF0ZSBvZiBDaGVja0JveGVzLCBkb24ndCBhZGQgaXQKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghKHRoaXMuYWNyb2Zvcm1QbHVnaW4ueEZvcm1zLmluZGV4T2Yob2JqKSA+PSAwKSkgdGhpcy5hY3JvZm9ybVBsdWdpbi54Rm9ybXMucHVzaChvYmopOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG9iaiA9IHZhbHVlOwogICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIG9iaiA9PT0gJ2Z1bmN0aW9uJykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaWYgRnVuY3Rpb24gaXMgcmVmZXJlbmNlZCwgY2FsbCBpdCBpbiBvcmRlciB0byBnZXQgdGhlIEZvcm1YT2JqZWN0CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvYmogPSBvYmouY2FsbCh0aGlzLCBmb3JtKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50ICs9ICIvIiArIGkgKyAiICIgKyBvYmogKyAiIFxuIjsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEodGhpcy5hY3JvZm9ybVBsdWdpbi54Rm9ybXMuaW5kZXhPZihvYmopID49IDApKSB0aGlzLmFjcm9mb3JtUGx1Z2luLnhGb3Jtcy5wdXNoKG9iaik7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIGNvbnRlbnQgKz0gIiA+PlxuIjsKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAvLyBhcHBlYXJhbmNlIHN0cmVhbSBpcyBhIG5vcm1hbCBPYmplY3QuLgogICAgICAgICAgICAgICAgY29udGVudCArPSAiPj5cbiI7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIGNvbnRlbnQgKz0gIj4+XG5lbmRvYmpcbiI7CgogICAgICAgICAgICB0aGlzLmludGVybmFsLm91dChjb250ZW50KTsKICAgICAgICB9CiAgICAgICAgaWYgKHN0YW5kYXJkRmllbGRzKSB7CiAgICAgICAgICAgIGNyZWF0ZVhGb3JtT2JqZWN0Q2FsbGJhY2suY2FsbCh0aGlzLCB0aGlzLmFjcm9mb3JtUGx1Z2luLnhGb3Jtcyk7CiAgICAgICAgfQogICAgfTsKCiAgICB2YXIgY3JlYXRlWEZvcm1PYmplY3RDYWxsYmFjayA9IGZ1bmN0aW9uIGNyZWF0ZVhGb3JtT2JqZWN0Q2FsbGJhY2soZmllbGRBcnJheSkgewogICAgICAgIGZvciAodmFyIGkgaW4gZmllbGRBcnJheSkgewogICAgICAgICAgICB2YXIga2V5ID0gaTsKICAgICAgICAgICAgdmFyIGZvcm0gPSBmaWVsZEFycmF5W2ldOwogICAgICAgICAgICAvLyBTdGFydCBXcml0aW5nIHRoZSBPYmplY3QKICAgICAgICAgICAgdGhpcy5pbnRlcm5hbC5uZXdPYmplY3REZWZlcnJlZEJlZ2luKGZvcm0gJiYgZm9ybS5vYmpJZCk7CgogICAgICAgICAgICB2YXIgY29udGVudCA9ICIiOwogICAgICAgICAgICBjb250ZW50ICs9IGZvcm0gPyBmb3JtLmdldFN0cmluZygpIDogJyc7CiAgICAgICAgICAgIHRoaXMuaW50ZXJuYWwub3V0KGNvbnRlbnQpOwoKICAgICAgICAgICAgZGVsZXRlIGZpZWxkQXJyYXlba2V5XTsKICAgICAgICB9CiAgICB9OwoKICAgIC8vIFB1YmxpYzo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1dHRvbgogICAgICogRlQgPSBCdG4KICAgICAqLwogICAgdmFyIGFkZEJ1dHRvbiA9IGZ1bmN0aW9uIGFkZEJ1dHRvbihvcHRpb25zKSB7CiAgICAgICAgdmFyIG9wdGlvbnMgPSBvcHRpb25zIHx8IG5ldyBBY3JvRm9ybS5GaWVsZCgpOwoKICAgICAgICBvcHRpb25zLkZUID0gJy9CdG4nOwoKICAgICAgICAvKioKICAgICAgICAgKiBDYWxjdWxhdGluZyB0aGUgRmYgZW50cnk6CiAgICAgICAgICoKICAgICAgICAgKiBUaGUgRmYgZW50cnkgY29udGFpbnMgZmxhZ3MsIHRoYXQgaGF2ZSB0byBiZSBzZXQgYml0d2lzZQogICAgICAgICAqIEluIHRoZSBGb2xsb3dpbmcgdGhlIG51bWJlciBpbiB0aGUgQ29tbWVudCBpcyB0aGUgQml0UG9zaXRpb24KICAgICAgICAgKi8KICAgICAgICB2YXIgZmxhZ3MgPSBvcHRpb25zLkZmIHx8IDA7CgogICAgICAgIC8vIDE3LCBQdXNoYnV0dG9uCiAgICAgICAgaWYgKG9wdGlvbnMucHVzaGJ1dHRvbikgewogICAgICAgICAgICAvLyBPcHRpb25zLnB1c2hidXR0b24gc2hvdWxkIGJlIDEgb3IgMAogICAgICAgICAgICBmbGFncyA9IEFjcm9Gb3JtLmludGVybmFsLnNldEJpdFBvc2l0aW9uKGZsYWdzLCAxNyk7CiAgICAgICAgICAgIGRlbGV0ZSBvcHRpb25zLnB1c2hidXR0b247CiAgICAgICAgfQoKICAgICAgICAvLzE2LCBSYWRpbwogICAgICAgIGlmIChvcHRpb25zLnJhZGlvKSB7CiAgICAgICAgICAgIC8vZmxhZ3MgPSBvcHRpb25zLkZmIHwgb3B0aW9ucy5yYWRpbyA8PCAxNTsKICAgICAgICAgICAgZmxhZ3MgPSBBY3JvRm9ybS5pbnRlcm5hbC5zZXRCaXRQb3NpdGlvbihmbGFncywgMTYpOwogICAgICAgICAgICBkZWxldGUgb3B0aW9ucy5yYWRpbzs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b3guT2ZmUHVzaERvd24KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfTsKCiAgICAgICAgICAgIHJldHVybiBhcHBlYXJhbmNlOwogICAgICAgIH0sCiAgICAgICAgLyoqCiAgICAgICAgICogSWYgYW55IG90aGVyIGljb25zIGFyZSBuZWVkZWQsIHRoZSBudW1iZXIgYmV0d2VlbiB0aGUgYnJhY2tldHMgY2FuIGJlIGNoYW5nZWQKICAgICAgICAgKiBAcmV0dXJucyB7c3RyaW5nfQogICAgICAgICAqLwogICAgICAgIGNyZWF0ZU1LOiBmdW5jdGlvbiBjcmVhdGVNSygpIHsKICAgICAgICAgICAgLy8gMy0+IEhvb2sKICAgICAgICAgICAgcmV0dXJuICI8PCAvQ0EgKDMpPj4iOwogICAgICAgIH0sCiAgICAgICAgLyoqCiAgICAgICAgICogUmV0dXJucyB0aGUgc3RhbmRhcmQgT24gQXBwZWFyYW5jZSBmb3IgYSBDaGVja0JveAogICAgICAgICAqIEByZXR1cm5zIHtBY3JvRm9ybS5Gb3JtWE9iamVjdH0KICAgICAgICAgKi8KICAgICAgICBZZXNQdXNoRG93bjogZnVuY3Rpb24gWWVzUHVzaERvd24oZm9ybU9iamVjdCkgewogICAgICAgICAgICB2YXIgeG9iaiA9IEFjcm9Gb3JtLmNyZWF0ZUZvcm1YT2JqZWN0KGZvcm1PYmplY3QpOwogICAgICAgICAgICB2YXIgc3RyZWFtID0gIiI7CiAgICAgICAgICAgIC8vIEYxMyBpcyBaYXBmRGluZ2JhdHMgKFN5bWJvbGljKQogICAgICAgICAgICBmb3JtT2JqZWN0LlEgPSAxOyAvLyBzZXQgdGV4dC1hbGlnbm1lbnQgYXMgY2VudGVyZWQKICAgICAgICAgICAgdmFyIGNhbGNSZXMgPSBBY3JvRm9ybS5pbnRlcm5hbC5jYWxjdWxhdGVYKGZvcm1PYmplY3QsICIzIiwgIlphcGZEaW5nYmF0cyIsIDUwKTsKICAgICAgICAgICAgc3RyZWFtICs9ICIwLjc0OTAyMyBnXG5cCiAgICAgICAgICAgICAwIDAgIiArIEFjcm9Gb3JtLkFwcGVhcmFuY2UuaW50ZXJuYWwuZ2V0V2lkdGgoZm9ybU9iamVjdCkgKyAiICIgKyBBY3JvRm9ybS5BcHBlYXJhbmNlLmludGVybmFsLmdldEhlaWdodChmb3JtT2JqZWN0KSArICIgcmVcblwKICAgICAgICAgICAgIGZcblwKICAgICAgICAgICAgIEJNQ1xuXAogICAgICAgICAgICAgcVxuXAogICAgICAgICAgICAgMCAwIDEgcmdcblwKICAgICAgICAgICAgIC9GMTMgIiArIGNhbGNSZXMuZm9udFNpemUgKyAiIFRmIDAgZ1xuXAogICAgICAgICAgICAgQlRcbiI7CiAgICAgICAgICAgIHN0cmVhbSArPSBjYWxjUmVzLnRleHQ7CiAgICAgICAgICAgIHN0cmVhbSArPSAiRVRcblwKICAgICAgICAgICAgIFFcblwKICAgICAgICAgICAgIEVNQ1xuIjsKICAgICAgICAgICAgeG9iai5zdHJlYW0gPSBzdHJlYW07CiAgICAgICAgICAgIHJldHVybiB4b2JqOwogICAgICAgIH0sCgogICAgICAgIFllc05vcm1hbDogZnVuY3Rpb24gWWVzTm9ybWFsKGZvcm1PYmplY3QpIHsKICAgICAgICAgICAgdmFyIHhvYmogPSBBY3JvRm9ybS5jcmVhdGVGb3JtWE9iamVjdChmb3JtT2JqZWN0KTsKICAgICAgICAgICAgdmFyIHN0cmVhbSA9ICIiOwogICAgICAgICAgICBmb3JtT2JqZWN0LlEgPSAxOyAvLyBzZXQgdGV4dC1hbGlnbm1lbnQgYXMgY2VudGVyZWQKICAgICAgICAgICAgdmFyIGNhbGNSZXMgPSBBY3JvRm9ybS5pbnRlcm5hbC5jYWxjdWxhdGVYKGZvcm1PYmplY3QsICIzIiwgIlphcGZEaW5nYmF0cyIsIEFjcm9Gb3JtLkFwcGVhcmFuY2UuaW50ZXJuYWwuZ2V0SGVpZ2h0KGZvcm1PYmplY3QpICogMC45KTsKICAgICAgICAgICAgc3RyZWFtICs9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DAgIiArIEFjcm9Gb3JtLkFwcGVhcmFuY2UuaW50ZXJuYWwuZ2V0V2lkdGgoZm9ybU9iamVjdCkgKyAiICIgKyBBY3JvRm9ybS5BcHBlYXJhbmNlLmludGVybmFsLmdldEhlaWdodChmb3JtT2JqZWN0KSArICIgcmVcblwKICAgICAgICAgICAgZlxuIjsKICAgICAgICAgICAgeG9iai5zdHJlYW0gPSBzdHJlYW07CiAgICAgICAgICAgIHJldHVybiB4b2JqOwogICAgICAgIH0KICAgIH0sCgogICAgUmFkaW9CdXR0b246IHsKICAgICAgICBDaXJjbGU6IHsKICAgICAgICAgICAgY3JlYXRlQXBwZWFyYW5jZVN0cmVhbTogZnVuY3Rpb24gY3JlYXRlQXBwZWFyYW5jZVN0cmVhbShuYW1lKSB7CiAgICAgICAgICAgICAgICB2YXIgYXBwZWFyYW5jZVN0cmVhbUNvbnRlbnQgPSB7CiAgICAgICAgICAgICAgICAgICAgRDogewogICAgICAgICAgICAgICAgICAgICAgICAnT2ZmJzogQWNyb0Zvcm0uQXBwZWFyYW5jZS5SYWRpb0J1dHRvbi5DaXJjbGUuT2ZmUHVzaERvd24KICAgICAgICAgICAgICAgICAgICB9LAogICAgICAgICAgICAgICAgICAgIE46IHt9CiAgICAgICAgICAgICAgICB9OwogICAgICAgICAgICAgICAgYXBwZWFyYW5jZVN0cmVhbUNvbnRlbnQuTltuYW1lXSA9IEFjcm9Gb3JtLkFwcGVhcmFuY2UuUmFkaW9CdXR0b24uQ2lyY2xlLlllc05vcm1hbDsKICAgICAgICAgICAgICAgIGFwcGVhcmFuY2VTdHJlYW1Db250ZW50LkRbbmFtZV0gPSBBY3JvRm9ybS5BcHBlYXJhbmNlLlJhZGlvQnV0dG9uLkNpcmNsZS5ZZXNQdXNoRG93bjsKICAgICAgICAgICAgICAgIHJldHVybiBhcHBlYXJhbmNlU3RyZWFtQ29udGVudDsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgY3JlYXRlTUs6IGZ1bmN0aW9uIGNy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bSArPSAicVxuXAoxIDAgMCAxICIgKyBBY3JvRm9ybS5BcHBlYXJhbmNlLmludGVybmFsLmdldFdpZHRoKGZvcm1PYmplY3QpIC8gMiArICIgIiArIEFjcm9Gb3JtLkFwcGVhcmFuY2UuaW50ZXJuYWwuZ2V0SGVpZ2h0KGZvcm1PYmplY3QpIC8gMiArICIgY21cblwKIiArIERvdFJhZGl1cyArICIgMCBtXG5cCiIgKyBEb3RSYWRpdXMgKyAiICIgKyBEb3RSYWRpdXMgKiBjICsgIiAiICsgRG90UmFkaXVzICogYyArICIgIiArIERvdFJhZGl1cyArICIgMCAiICsgRG90UmFkaXVzICsgIiBjXG5cCi0iICsgRG90UmFkaXVzICogYyArICIgIiArIERvdFJhZGl1cyArICIgLSIgKyBEb3RSYWRpdXMgKyAiICIgKyBEb3RSYWRpdXMgKiBjICsgIiAtIiArIERvdFJhZGl1cyArICIgMCBjXG5cCi0iICsgRG90UmFkaXVzICsgIiAtIiArIERvdFJhZGl1cyAqIGMgKyAiIC0iICsgRG90UmFkaXVzICogYyArICIgLSIgKyBEb3RSYWRpdXMgKyAiIDAgLSIgKyBEb3RSYWRpdXMgKyAiIGNcblwKIiArIERvdFJhZGl1cyAqIGMgKyAiIC0iICsgRG90UmFkaXVzICsgIiAiICsgRG90UmFkaXVzICsgIiAtIiArIERvdFJhZGl1cyAqIGMgKyAiICIgKyBEb3RSYWRpdXMgKyAiIDAgY1xuXApmXG5cClFcbiI7CiAgICAgICAgICAgICAgICB4b2JqLnN0cmVhbSA9IHN0cmVhbTsKICAgICAgICAgICAgICAgIHJldHVybiB4b2JqOwogICAgICAgICAgICB9LAogICAgICAgICAgICBZZXNQdXNoRG93bjogZnVuY3Rpb24gWWVzUHVzaERvd24oZm9ybU9iamVjdCkgewogICAgICAgICAgICAgICAgdmFyIHhvYmogPSBBY3JvRm9ybS5jcmVhdGVGb3JtWE9iamVjdChmb3JtT2JqZWN0KTsKICAgICAgICAgICAgICAgIHZhciBzdHJlYW0gPSAi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5nZXRXaWR0aChmb3JtT2JqZWN0KSAvIDIgKyAiICIgKyBBY3JvRm9ybS5BcHBlYXJhbmNlLmludGVybmFsLmdldEhlaWdodChmb3JtT2JqZWN0KSAvIDIgKyAiIGNtXG5cCiAgICAgICAgICAgICAgICAvLyAiICsgRG90UmFkaXVzICogMiArICIgMCBtXG5cCiAgICAgICAgICAgICAgICAvLyAiICsgRG90UmFkaXVzICogMiArICIgIiArIERvdFJhZGl1cyAqIDIgKiBjICsgIiAiICsgRG90UmFkaXVzICogMiAqIGMgKyAiICIgKyBEb3RSYWRpdXMgKiAyICsgIiAwICIgKyBEb3RSYWRpdXMgKiAyICsgIiBjXG5cCiAgICAgICAgICAgICAgICAvLyAtIiArIERvdFJhZGl1cyAqIDIgKiBjICsgIiAiICsgRG90UmFkaXVzICogMiArICIgLSIgKyBEb3RSYWRpdXMgKiAyICsgIiAiICsgRG90UmFkaXVzICogMiAqIGMgKyAiIC0iICsgRG90UmFkaXVzICogMiArICIgMCBjXG5cCiAgICAgICAgICAgICAgICAvLyAtIiArIERvdFJhZGl1cyAqIDIgKyAiIC0iICsgRG90UmFkaXVzICogMiAqIGMgKyAiIC0iICsgRG90UmFkaXVzICogMiAqIGMgKyAiIC0iICsgRG90UmFkaXVzICogMiArICIgMCAtIiArIERvdFJhZGl1cyAqIDIgKyAiIGNcblwKICAgICAgICAgICAgICAgIC8vICIgKyBEb3RSYWRpdXMgKiAyICogYyArICIgLSIgKyBEb3RSYWRpdXMgKiAyICsgIiAiICsgRG90UmFkaXVzICogMiArICIgLSIgKyBEb3RSYWRpdXMgKiAyICogYyArICIgIiArIERvdFJhZGl1cyAqIDIgKyAiIDAgY1xuXAogICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgZlxuXAogICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgUVxuXAogICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgMCBnXG5cCiAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICBxXG5cCiAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAxIDAgMCAxICIgKyBBY3JvRm9ybS5BcHBlYXJhbmNlLmludGVybmFsLmdldFdpZHRoKGZvcm1PYmplY3QpIC8gMiArICIgIiArIEFjcm9Gb3JtLkFwcGVhcmFuY2UuaW50ZXJuYWwuZ2V0SGVpZ2h0KGZvcm1PYmplY3QpIC8gMiArICIgY21cblwKICAgICAgICAgICAgICAgIC8vICIgKyBEb3RSYWRpdXMgKyAiIDAgbVxuXAogICAgICAgICAgICAgICAgLy8gIiArIERvdFJhZGl1cyArICIgIiArIERvdFJhZGl1cyAqIGMgKyAiICIgKyBEb3RSYWRpdXMgKiBjICsgIiAiICsgRG90UmFkaXVzICsgIiAwICIgKyBEb3RSYWRpdXMgKyAiIGNcblwKICAgICAgICAgICAgICAgIC8vIC0iICsgRG90UmFkaXVzICogYyArICIgIiArIERvdFJhZGl1cyArICIgLSIgKyBEb3RSYWRpdXMgKyAiICIgKyBEb3RSYWRpdXMgKiBjICsgIiAtIiArIERvdFJhZGl1cyArICIgMCBjXG5cCiAgICAgICAgICAgICAgICAvLyAtIiArIERvdFJhZGl1cyArICIgLSIgKyBEb3RSYWRpdXMgKiBjICsgIiAtIiArIERvdFJhZGl1cyAqIGMgKyAiIC0iICsgRG90UmFkaXVzICsgIiAwIC0iICsgRG90UmFkaXVzICsgIiBjXG5cCiAgICAgICAgICAgICAgICAvLyAiICsgRG90UmFkaXVzICogYyArICIgLSIgKyBEb3RSYWRpdXMgKyAiICIgKyBEb3RSYWRpdXMgKyAiIC0iICsgRG90UmFkaXVzICogYyArICIgIiArIERvdFJhZGl1cyArICIgMCBjXG5cCiAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICBmXG5cCiAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICBRXG4iOwoKICAgICAgICAgICAgICAgIC8vICBGQVNURVIgVkVSU0lPTiB3aXRoIGxlc3MgcHJvY2Vzc29yIHRpY2tzIHNwZW50IG9uIG1hdGggb3BlcmF0aW9ucwogICAgICAgICAgICAgICAgc3RyZWFtICs9ICIwLjc0OTAyMyBnXG5cCiAgICAgICAgICAgIHFcblwKICAgICAgICAgICAxIDAgMCAxICIgKyBBY3JvRm9ybS5BcHBlYXJhbmNlLmludGVybmFsLmdldFdpZHRoKGZvcm1PYmplY3QpIC8gMiArICIgIiArIEFjcm9Gb3JtLkFwcGVhcmFuY2UuaW50ZXJuYWwuZ2V0SGVpZ2h0KGZvcm1PYmplY3QpIC8gMiArICIgY21cblwKIiArIGsgKyAiIDAgbVxuXAoiICsgayArICIgIiArIGtjICsgIiAiICsga2MgKyAiICIgKyBrICsgIiAwICIgKyBrICsgIiBjXG5cCi0iICsga2MgKyAiICIgKyBrICsgIiAtIiArIGsgKyAiICIgKyBrYyArICIgLSIgKyBrICsgIiAwIGNcblwKLSIgKyBrICsgIiAtIiArIGtjICsgIiAtIiArIGtjICsgIiAtIiArIGsgKyAiIDAgLSIgKyBrICsgIiBjXG5cCiIgKyBrYyArICIgLSIgKyBrICsgIiAiICsgayArICIgLSIgKyBrYyArICIgIiArIGsgKyAiIDAgY1xuXAogICAgICAgICAgICBmXG5cCiAgICAgICAgICAgIFFcblwKICAgICAgICAgICAgMCBnXG5cCiAgICAgICAgICAgIHFcblwKICAgICAgICAgICAgMSAwIDAgMSAiICsgQWNyb0Zvcm0uQXBwZWFyYW5jZS5pbnRlcm5hbC5nZXRXaWR0aChmb3JtT2JqZWN0KSAvIDIgKyAiICIgKyBBY3JvRm9ybS5BcHBlYXJhbmNlLmludGVybmFsLmdldEhlaWdodChmb3JtT2JqZWN0KSAvIDIgKyAiIGNtXG5cCiIgKyBEb3RSYWRpdXMgKyAiIDAgbVxuXAoiICsgRG90UmFkaXVzICsgIiAiICsgZGMgKyAiICIgKyBkYyArICIgIiArIERvdFJhZGl1cyArICIgMCAiICsgRG90UmFkaXVzICsgIiBjXG5cCi0iICsgZGMgKyAiICIgKyBEb3RSYWRpdXMgKyAiIC0iICsgRG90UmFkaXVzICsgIiAiICsgZGMgKyAiIC0iICsgRG90UmFkaXVzICsgIiAwIGNcblwKLSIgKyBEb3RSYWRpdXMgKyAiIC0iICsgZGMgKyAiIC0iICsgZGMgKyAiIC0iICsgRG90UmFkaXVzICsgIiAwIC0iICsgRG90UmFkaXVzICsgIiBjXG5cCiIgKyBkYyArICIgLSIgKyBEb3RSYWRpdXMgKyAiICIgKyBEb3RSYWRpdXMgKyAiIC0iICsgZGMgKyAiICIgKyBEb3RSYWRpdXMgKyAiIDAgY1xuXAogICAgICAgICAgICBmXG5cCiAgICAgICAgICAgIFFcbiI7CiAgICAgICAgICAgICAgICB4b2JqLnN0cmVhbSA9IHN0cmVhbTsKICAgICAgICAgICAgICAgIHJldHVybiB4b2JqOwogICAgICAgICAgICB9LAogICAgICAgICAgICBPZmZQdXNoRG93bjogZnVuY3Rpb24gT2ZmUHVzaERvd24oZm9ybU9iamVjdCkgewogICAgICAgICAgICAgICAgdmFyIHhvYmogPSBBY3JvRm9ybS5jcmVhdGVGb3JtWE9iamVjdChmb3JtT2JqZWN0KTsKICAgICAgICAgICAgICAgIHZhciBzdHJlYW0gPSAiIjsKICAgICAgICAgICAgICAgIHZhciBEb3RSYWRpdXMgPSBBY3JvRm9ybS5BcHBlYXJhbmNlLmludGVybmFsLmdldFdpZHRoKGZvcm1PYmplY3QpIDw9IEFjcm9Gb3JtLkFwcGVhcmFuY2UuaW50ZXJuYWwuZ2V0SGVpZ2h0KGZvcm1PYmplY3QpID8gQWNyb0Zvcm0uQXBwZWFyYW5jZS5pbnRlcm5hbC5nZXRXaWR0aChmb3JtT2JqZWN0KSAvIDQgOiBBY3JvRm9ybS5BcHBlYXJhbmNlLmludGVybmFsLmdldEhlaWdodChmb3JtT2JqZWN0KSAvIDQ7CiAgICAgICAgICAgICAgICAvLyBUaGUgQm9yZGVycGFkZGluZy4uLgogICAgICAgICAgICAgICAgRG90UmFkaXVzICo9IDAuOTsKICAgICAgICAgICAgICAgIC8vIFNhdmUgcmVzdWx0cyBmb3IgbGF0ZXIgdXNlOyBubyBuZWVkIHRvIHdhc3RlIHByb2Nlc3NvciB0aWNrcyBvbiBkb2luZyBtYXRoCiAgICAgICAgICAgICAgICB2YXIgayA9IERvdFJhZGl1cyAqIDI7CiAgICAgICAgICAgICAgICAvLyB2YXIgYyA9IEFjcm9Gb3JtLkFwcGVhcmFuY2UuaW50ZXJuYWwuQmV6aWVyX0M7CiAgICAgICAgICAgICAgICB2YXIga2MgPSBrICogQWNyb0Zvcm0uQXBwZWFyYW5jZS5pbnRlcm5hbC5CZXppZXJfQzsKICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICBzdHJlYW0gKz0gIjAuNzQ5MDIzIGdcblwKICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgIHFcblwKICAgICAgICAgICAgICAgIC8vICAxIDAgMCAxICIgKyBBY3JvRm9ybS5BcHBlYXJhbmNlLmludGVybmFsLmdldFdpZHRoKGZvcm1PYmplY3QpIC8gMiArICIgIiArIEFjcm9Gb3JtLkFwcGVhcmFuY2UuaW50ZXJuYWwuZ2V0SGVpZ2h0KGZvcm1PYmplY3QpIC8gMiArICIgY21cblwKICAgICAgICAgICAgICAgIC8vICIgKyBEb3RSYWRpdXMgKiAyICsgIiAwIG1cblwKICAgICAgICAgICAgICAgIC8vICIgKyBEb3RSYWRpdXMgKiAyICsgIiAiICsgRG90UmFkaXVzICogMiAqIGMgKyAiICIgKyBEb3RSYWRpdXMgKiAyICogYyArICIgIiArIERvdFJhZGl1cyAqIDIgKyAiIDAgIiArIERvdFJhZGl1cyAqIDIgKyAiIGNcblwKICAgICAgICAgICAgICAgIC8vIC0iICsgRG90UmFkaXVzICogMiAqIGMgKyAiICIgKyBEb3RSYWRpdXMgKiAyICsgIiAtIiArIERvdFJhZGl1cyAqIDIgKyAiICIgKyBEb3RSYWRpdXMgKiAyICogYyArICIgLSIgKyBEb3RSYWRpdXMgKiAyICsgIiAwIGNcblwKICAgICAgICAgICAgICAgIC8vIC0iICsgRG90UmFkaXVzICogMiArICIgLSIgKyBEb3RSYWRpdXMgKiAyICogYyArICIgLSIgKyBEb3RSYWRpdXMgKiAyICogYyArICIgLSIgKyBEb3RSYWRpdXMgKiAyICsgIiAwIC0iICsgRG90UmFkaXVzICogMiArICIgY1xuXAogICAgICAgICAgICAgICAgLy8gIiArIERvdFJhZGl1cyAqIDIgKiBjICsgIiAtIiArIERvdFJhZGl1cyAqIDIgKyAiICIgKyBEb3RSYWRpdXMgKiAyICsgIiAtIiArIERvdFJhZGl1cyAqIDIgKiBjICsgIiAiICsgRG90UmFkaXVzICogMiArICIgMCBjXG5cCiAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICBmXG5cCiAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICBRXG4iOwoKICAgICAgICAgICAgICAgIC8vICBGQVNURVIgVkVSU0lPTiB3aXRoIGxlc3MgcHJvY2Vzc29yIHRpY2tzIHNwZW50IG9uIG1hdGggb3BlcmF0aW9ucwogICAgICAgICAgICAgICAgc3RyZWFtICs9ICIwLjc0OTAyMyBnXG5cCiAgICAgICAgICAgIHFcblwKIDEgMCAwIDEgIiArIEFjcm9Gb3JtLkFwcGVhcmFuY2UuaW50ZXJuYWwuZ2V0V2lkdGgoZm9ybU9iamVjdCkgLyAyICsgIiAiICsgQWNyb0Zvcm0uQXBwZWFyYW5jZS5pbnRlcm5hbC5nZXRIZWlnaHQoZm9ybU9iamVjdCkgLyAyICsgIiBjbVxuXAoiICsgayArICIgMCBtXG5cCiIgKyBrICsgIiAiICsga2MgKyAiICIgKyBrYyArICIgIiArIGsgKyAiIDAgIiArIGsgKyAiIGNcblwKLSIgKyBrYyArICIgIiArIGsgKyAiIC0iICsgayArICIgIiArIGtjICsgIiAtIiArIGsgKyAiIDAgY1xuXAotIiArIGsgKyAiIC0iICsga2MgKyAiIC0iICsga2MgKyAiIC0iICsgayArICIgMCAtIiArIGsgKyAiIGNcblwKIiArIGtjICsgIiAtIiArIGsgKyAiICIgKyBrICsgIiAtIiArIGtjICsgIiAiICsgayArICIgMCBjXG5cCiAgICAgICAgICAgIGZcblwKICAgICAgICAgICAgUVxuIjsKICAgICAgICAgICAgICAgIHhvYmouc3RyZWFtID0gc3RyZWFtOwogICAgICAgICAgICAgICAgcmV0dXJuIHhvYmo7CiAgICAgICAgICAgIH0KICAgICAgICB9LAoKICAgICAgICBDcm9zczogewogICAgICAgICAgICAvKioKICAgICAgICAgICAgICogQ3JlYXRlcyB0aGUgQWN0dWFsIEFwcGVhcmFuY2VEaWN0aW9uYXJ5LVJlZmVyZW5jZXMKICAgICAgICAgICAgICogQHBhcmFtIG5hbWUKICAgICAgICAgICAgICogQHJldHVybnMKICAgICAgICAgICAgICovCiAgICAgICAgICAgIGNyZWF0ZUFwcGVhcmFuY2VTdHJlYW06IGZ1bmN0aW9uIGNyZWF0ZUFwcGVhcmFuY2VTdHJlYW0obmFtZSkgewogICAgICAgICAgICAgICAgdmFyIGFwcGVhcmFuY2VTdHJlYW1Db250ZW50ID0gewogICAgICAgICAgICAgICAgICAgIEQ6IHsKICAgICAgICAgICAgICAgICAgICAgICAgJ09mZic6IEFjcm9Gb3JtLkFwcGVhcmFuY2UuUmFkaW9CdXR0b24uQ3Jvc3MuT2ZmUHVzaERvd24KICAgICAgICAgICAgICAgICAgICB9LAogICAgICAgICAgICAgICAgICAgIE46IHt9CiAgICAgICAgICAgICAgICB9OwogICAgICAgICAgICAgICAgYXBwZWFyYW5jZVN0cmVhbUNvbnRlbnQuTltuYW1lXSA9IEFjcm9Gb3JtLkFwcGVhcmFuY2UuUmFkaW9CdXR0b24uQ3Jvc3MuWWVzTm9ybWFsOwogICAgICAgICAgICAgICAgYXBwZWFyYW5jZVN0cmVhbUNvbnRlbnQuRFtuYW1lXSA9IEFjcm9Gb3JtLkFwcGVhcmFuY2UuUmFkaW9CdXR0b24uQ3Jvc3MuWWVzUHVzaERvd247CiAgICAgICAgICAgICAgICByZXR1cm4gYXBwZWFyYW5jZVN0cmVhbUNvbnRlbnQ7CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIGNyZWF0ZU1LOiBmdW5jdGlvbiBjcmVhdGVNSygpIHsKICAgICAgICAgICAgICAgIHJldHVybiAiPDwgL0NBICg4KT4+IjsKICAgICAgICAgICAgfSwKCiAgICAgICAgICAgIFllc05vcm1hbDogZnVuY3Rpb24gWWVzTm9ybWFsKGZvcm1PYmplY3QpIHsKICAgICAgICAgICAgICAgIHZhciB4b2JqID0gQWNyb0Zvcm0uY3JlYXRlRm9ybVhPYmplY3QoZm9ybU9iamVjdCk7CiAgICAgICAgICAgICAgICB2YXIgc3RyZWFtID0gIiI7CiAgICAgICAgICAgICAgICB2YXIgY3Jvc3MgPSBBY3JvRm9ybS5BcHBlYXJhbmNlLmludGVybmFsLmNhbGN1bGF0ZUNyb3NzKGZvcm1PYmplY3QpOwogICAgICAgICAgICAgICAgc3RyZWFtICs9ICJxXG5cCiAgICAgICAgICAgIDEgMSAiICsgKEFjcm9Gb3JtLkFwcGVhcmFuY2UuaW50ZXJuYWwuZ2V0V2lkdGgoZm9ybU9iamVjdCkgLSAyKSArICIgIiArIChBY3JvRm9ybS5BcHBlYXJhbmNlLmludGVybmFsLmdldEhlaWdodChmb3JtT2JqZWN0KSAtIDIpICsgIiByZVxuXAogICAgICAgICAgICBXXG5cCiAgICAgICAgICAgIG5cblwKICAgICAgICAgICAgIiArIGNyb3NzLngxLnggKyAiICIgKyBjcm9zcy54MS55ICsgIiBtXG5cCiAgICAgICAgICAgICIgKyBjcm9zcy54Mi54ICsgIiAiICsgY3Jvc3MueDIueSArICIgbFxuXAogICAgICAgICAgICAiICsgY3Jvc3MueDQueCArICIgIiArIGNyb3NzLng0LnkgKyAiIG1cblwKICAgICAgICAgICAgIiArIGNyb3NzLngzLnggKyAiICIgKyBjcm9zcy54My55ICsgIiBsXG5cCiAgICAgICAgICAgIHNcblwKICAgICAgICAgICAgUVxuIjsKICAgICAgICAgICAgICAgIHhvYmouc3RyZWFtID0gc3RyZWFtOwogICAgICAgICAgICAgICAgcmV0dXJuIHhvYmo7CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIFllc1B1c2hEb3duOiBmdW5jdGlvbiBZZXNQdXNoRG93bihmb3JtT2JqZWN0KSB7CiAgICAgICAgICAgICAgICB2YXIgeG9iaiA9IEFjcm9Gb3JtLmNyZWF0ZUZvcm1YT2JqZWN0KGZvcm1PYmplY3QpOwogICAgICAgICAgICAgICAgdmFyIGNyb3NzID0gQWNyb0Zvcm0uQXBwZWFyYW5jZS5pbnRlcm5hbC5jYWxjdWxhdGVDcm9zcyhmb3JtT2JqZWN0KTsKICAgICAgICAgICAgICAgIHZhciBzdHJlYW0gPSAiIjsKICAgICAgICAgICAgICAgIHN0cmVhbSArPSAiMC43NDkwMjMgZ1xuXAogICAgICAgICAgICAwIDAgIiArIEFjcm9Gb3JtLkFwcGVhcmFuY2UuaW50ZXJuYWwuZ2V0V2lkdGgoZm9ybU9iamVjdCkgKyAiICIgKyBBY3JvRm9ybS5BcHBlYXJhbmNlLmludGVybmFsLmdldEhlaWdodChmb3JtT2JqZWN0KSArICIgcmVcblwKICAgICAgICAgICAgZlxuXAogICAgICAgICAgICBxXG5cCiAgICAgICAgICAgIDEgMSAiICsgKEFjcm9Gb3JtLkFwcGVhcmFuY2UuaW50ZXJuYWwuZ2V0V2lkdGgoZm9ybU9iamVjdCkgLSAyKSArICIgIiArIChBY3JvRm9ybS5BcHBlYXJhbmNlLmludGVybmFsLmdldEhlaWdodChmb3JtT2JqZWN0KSAtIDIpICsgIiByZVxuXAogICAgICAgICAgICBXXG5cCiAgICAgICAgICAgIG5cblwKICAgICAgICAgICAgIiArIGNyb3NzLngxLnggKyAiICIgKyBjcm9zcy54MS55ICsgIiBtXG5cCiAgICAgICAgICAgICIgKyBjcm9zcy54Mi54ICsgIiAiICsgY3Jvc3MueDIueSArICIgbFxuXAogICAgICAgICAgICAiICsgY3Jvc3MueDQueCArICIgIiArIGNyb3NzLng0LnkgKyAiIG1cblwKICAgICAgICAgICAgIiArIGNyb3NzLngzLnggKyAiICIgKyBjcm9zcy54My55ICsgIiBsXG5cCiAgICAgICAgICAgIHNcblwKICAgICAgICAgICAgUVxuIjsKICAgICAgICAgICAgICAgIHhvYmouc3RyZWFtID0gc3RyZWFtOwogICAgICAgICAgICAgICAgcmV0dXJuIHhvYmo7CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIE9mZlB1c2hEb3duOiBmdW5jdGlvbiBPZmZQdXNoRG93bihmb3JtT2JqZWN0KSB7CiAgICAgICAgICAgICAgICB2YXIgeG9iaiA9IEFjcm9Gb3JtLmNyZWF0ZUZvcm1YT2JqZWN0KGZvcm1PYmplY3QpOwogICAgICAgICAgICAgICAgdmFyIHN0cmVhbSA9ICIiOwogICAgICAgICAgICAgICAgc3RyZWFtICs9ICIwLjc0OTAyMyBnXG5cCiAgICAgICAgICAgIDAgMCAiICsgQWNyb0Zvcm0uQXBwZWFyYW5jZS5pbnRlcm5hbC5nZXRXaWR0aChmb3JtT2JqZWN0KSArICIgIiArIEFjcm9Gb3JtLkFwcGVhcmFuY2UuaW50ZXJuYWwuZ2V0SGVpZ2h0KGZvcm1PYmplY3QpICsgIiByZVxuXAogICAgICAgICAgICBmXG4iOwogICAgICAgICAgICAgICAgeG9iai5zdHJlYW0gPSBzdHJlYW07CiAgICAgICAgICAgICAgICByZXR1cm4geG9iajsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0sCgogICAgLyoqCiAgICAgKiBSZXR1cm5zIHRoZSBzdGFuZGFyZCBBcHBlYXJhbmNlCiAgICAgKiBAcmV0dXJucyB7QWNyb0Zvcm0uRm9ybVhPYmplY3R9CiAgICAgKi8KICAgIGNyZWF0ZURlZmF1bHRBcHBlYXJhbmNlU3RyZWFtOiBmdW5jdGlvbiBjcmVhdGVEZWZhdWx0QXBwZWFyYW5jZVN0cmVhbShmb3JtT2JqZWN0KSB7CiAgICAgICAgdmFyIHN0cmVhbSA9ICIiOwogICAgICAgIC8vIFNldCBIZWx2ZXRpY2EgdG8gU3RhbmRhcmQgRm9udCAoc2l6ZTogYXV0bykKICAgICAgICAvLyBDb2xvcjogQmxhY2sKICAgICAgICBzdHJlYW0gKz0gIi9IZWx2IDAgVGYgMCBnIjsKICAgICAgICByZXR1cm4gc3RyZWFtOwogICAgfQp9OwoKQWNyb0Zvcm0uQXBwZWFyYW5jZS5pbnRlcm5hbCA9IHsKICAgIEJlemllcl9DOiAwLjU1MTkxNTAyNDQ5NCwKCiAgICBjYWxjdWxhdGVDcm9zczogZnVuY3Rpb24gY2FsY3VsYXRlQ3Jvc3MoZm9ybU9iamVjdCkgewogICAgICAgIHZhciBtaW4gPSBmdW5jdGlvbiBtaW4oeCwgeSkgewogICAgICAgICAgICByZXR1cm4geCA+IHkgPyB5IDogeDsKICAgICAgICB9OwoKICAgICAgICB2YXIgd2lkdGggPSBBY3JvRm9ybS5BcHBlYXJhbmNlLmludGVybmFsLmdldFdpZHRoKGZvcm1PYmplY3QpOwogICAgICAgIHZhciBoZWlnaHQgPSBBY3JvRm9ybS5BcHBlYXJhbmNlLmludGVybmFsLmdldEhlaWdodChmb3JtT2JqZWN0KTsKICAgICAgICB2YXIgYSA9IG1pbih3aWR0aCwgaGVpZ2h0KTsKICAgICAgICB2YXIgY3Jvc3NTaXplID0gYTsKICAgICAgICB2YXIgYm9yZGVyUGFkZGluZyA9IDI7IC8vIFRoZSBQYWRkaW5nIGluIHB4CgoKICAgICAgICB2YXIgY3Jvc3MgPSB7CiAgICAgICAgICAgIHgxOiB7IC8vIHVwcGVyTGVmdAogICAgICAgICAgICAgICAgeDogKHdpZHRoIC0gYSkgLyAyLAogICAgICAgICAgICAgICAgeTogKGhlaWdodCAtIGEpIC8gMiArIGEgfSwKICAgICAgICAgICAgeDI6IHsgLy8gbG93ZXJSaWdodAogICAgICAgICAgICAgICAgeDogKHdpZHRoIC0gYSkgLyAyICsgYSwKICAgICAgICAgICAgICAgIHk6IChoZWlnaHQgLSBhKSAvIDIgLy9ib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R5cGUgPSBvOwogICAgICAgIHJldHVybiBuZXcgRigpOwogICAgfTsKICAgIGNoaWxkLnByb3RvdHlwZSA9IE9iamVjdC5jcmVhdGUocGFyZW50LnByb3RvdHlwZSk7CiAgICBjaGlsZC5wcm90b3R5cGUuY29uc3RydWN0b3IgPSBjaGlsZDsKfTsKCi8vICMjIyBIYW5keSBGdW5jdGlvbnM6CgpBY3JvRm9ybS5pbnRlcm5hbC5hcnJheVRvUGRmQXJyYXkgPSBmdW5jdGlvbiAoYXJyYXkpIHsKICAgIGlmIChBcnJheS5pc0FycmF5KGFycmF5KSkgewogICAgICAgIHZhciBjb250ZW50ID0gJyBbJzsKICAgICAgICBmb3IgKHZhciBpIGluIGFycmF5KSB7CiAgICAgICAgICAgIHZhciBlbGVtZW50ID0gYXJyYXlbaV0udG9TdHJpbmcoKTsKICAgICAgICAgICAgY29udGVudCArPSBlbGVtZW50OwogICAgICAgICAgICBjb250ZW50ICs9IGkgPCBhcnJheS5sZW5ndGggLSAxID8gJyAnIDogJyc7CiAgICAgICAgfQogICAgICAgIGNvbnRlbnQgKz0gJ10nOwoKICAgICAgICByZXR1cm4gY29udGVudDsKICAgIH0KfTsKCkFjcm9Gb3JtLmludGVybmFsLnRvUGRmU3RyaW5nID0gZnVuY3Rpb24gKHN0cmluZykgewogICAgc3RyaW5nID0gc3RyaW5nIHx8ICIiOwoKICAgIC8vIHB1dCBCcmFja2V0IGF0IHRoZSBCZWdpbm5pbmcgb2YgdGhlIFN0cmluZwogICAgaWYgKHN0cmluZy5pbmRleE9mKCcoJykgIT09IDApIHsKICAgICAgICBzdHJpbmcgPSAnKCcgKyBzdHJpbmc7CiAgICB9CgogICAgaWYgKHN0cmluZy5zdWJzdHJpbmcoc3RyaW5nLmxlbmd0aCAtIDEpICE9ICcpJykgewogICAgICAgIHN0cmluZyArPSAnKCc7CiAgICB9CiAgICByZXR1cm4gc3RyaW5nOwp9OwoKLy8gIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMKLy8gICAgICAgICAgQ2xhc3NlcwovLyAjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIwoKCkFjcm9Gb3JtLlBERk9iamVjdCA9IGZ1bmN0aW9uICgpIHsKICAgIC8vIFRoZSBPYmplY3QgSUQgaW4gdGhlIFBERiBPYmplY3QgTW9kZWwKICAgIC8vIHRvZG8KICAgIHZhciBfb2JqSWQ7CiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkodGhpcywgJ29iaklkJywgewogICAgICAgIGdldDogZnVuY3Rpb24gZ2V0KCkgewogICAgICAgICAgICBpZiAoIV9vYmpJZCkgewogICAgICAgICAgICAgICAgaWYgKHRoaXMuaW50ZXJuYWwpIHsKICAgICAgICAgICAgICAgICAgICBfb2JqSWQgPSB0aGlzLmludGVybmFsLm5ld09iamVjdERlZmVycmVkKCk7CiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGpzUERGLkFQSS5hY3JvZm9ybVBsdWdpbi5pbnRlcm5hbCkgewogICAgICAgICAgICAgICAgICAgIC8vIHRvZG8gLSBmaW5kIGJldHRlciBvcHRpb24sIHRoYXQgZG9lc24ndCByZWx5IG9uIGEgR2xvYmFsIFN0YXRpYyB2YXIKICAgICAgICAgICAgICAgICAgICBfb2JqSWQgPSBqc1BERi5BUEkuYWNyb2Zvcm1QbHVnaW4uaW50ZXJuYWwubmV3T2JqZWN0RGVmZXJyZWQoKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICBpZiAoIV9vYmpJZCkgewogICAgICAgICAgICAgICAgY29uc29sZS5sb2coIkNvdWxkbid0IGNyZWF0ZSBPYmplY3QgSUQiKTsKICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gX29iaklkOwogICAgICAgIH0sCiAgICAgICAgY29uZmlndXJhYmxlOiBmYWxzZQogICAgfSk7Cn07CgpBY3JvRm9ybS5QREZPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nID0gZnVuY3Rpb24gKCkgewogICAgcmV0dXJuIHRoaXMub2JqSWQgKyAiIDAgUiI7Cn07CgpBY3JvRm9ybS5QREZPYmplY3QucHJvdG90eXBlLmdldFN0cmluZyA9IGZ1bmN0aW9uICgpIHsKICAgIHZhciByZXMgPSB0aGlzLm9iaklkICsgIiAwIG9ialxuPDwiOwogICAgdmFyIGNvbnRlbnQgPSB0aGlzLmdldENvbnRlbnQoKTsKCiAgICByZXMgKz0gY29udGVudCArICI+PlxuIjsKICAgIGlmICh0aGlzLnN0cmVhbSkgewogICAgICAgIHJlcyArPSAic3RyZWFtXG4iOwogICAgICAgIHJlcyArPSB0aGlzLnN0cmVhbTsKICAgICAgICByZXMgKz0gImVuZHN0cmVhbVxuIjsKICAgIH0KICAgIHJlcyArPSAiZW5kb2JqXG4iOwogICAgcmV0dXJuIHJlczsKfTsKCkFjcm9Gb3JtLlBERk9iamVjdC5wcm90b3R5cGUuZ2V0Q29udGVudCA9IGZ1bmN0aW9uICgpIHsKICAgIC8qKgogICAgICogUHJpbnRzIG91dCBhbGwgZW51bWVyYWJsZSBWYXJpYWJsZXMgZnJvbSB0aGUgT2JqZWN0CiAgICAgKiBAcGFyYW0gZmllbGRPYmplY3QKICAgICAqIEByZXR1cm5zIHtzdHJpbmd9CiAgICAgKi8KICAgIHZhciBjcmVhdGVDb250ZW50RnJvbUZpZWxkT2JqZWN0ID0gZnVuY3Rpb24gY3JlYXRlQ29udGVudEZyb21GaWVsZE9iamVjdChmaWVsZE9iamVjdCkgewogICAgICAgIHZhciBjb250ZW50ID0gJyc7CgogICAgICAgIHZhciBrZXlzID0gT2JqZWN0LmtleXMoZmllbGRPYmplY3QpLmZpbHRlcihmdW5jdGlvbiAoa2V5KSB7CiAgICAgICAgICAgIHJldHVybiBrZXkgIT0gJ2NvbnRlbnQnICYmIGtleSAhPSAnYXBwZWFyYW5jZVN0cmVhbUNvbnRlbnQnICYmIGtleS5zdWJzdHJpbmcoMCwgMSkgIT0gIl8iOwogICAgICAgIH0pOwoKICAgICAgICBmb3IgKHZhciBpIGluIGtleXMpIHsKICAgICAgICAgICAgdmFyIGtleSA9IGtleXNbaV07CiAgICAgICAgICAgIHZhciB2YWx1ZSA9IGZpZWxkT2JqZWN0W2tleV07CgogICAgICAgICAgICAvKmlmIChrZXkgPT0gJ1JlY3QnICYmIHZhbHVlKSB7CiAgICAgICAgICAgICB2YWx1ZSA9IEFjcm9Gb3JtLmludGVybmFsLmNhbGN1bGF0ZUNvb3JkaW5hdGVzLmNhbGwoanNQREYuQVBJLmFjcm9mb3JtUGx1Z2luLmludGVybmFsLCB2YWx1ZSk7CiAgICAgICAgICAgICB9Ki8KCiAgICAgICAgICAgIGlmICh2YWx1ZSkgewogICAgICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkodmFsdWUpKSB7CiAgICAgICAgICAgICAgICAgICAgY29udGVudCArPSAnLycgKyBrZXkgKyAnICcgKyBBY3JvRm9ybS5pbnRlcm5hbC5hcnJheVRvUGRmQXJyYXkodmFsdWUpICsgIlxuIjsKICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodmFsdWUgaW5zdGFuY2VvZiBBY3JvRm9ybS5QREZPYmplY3QpIHsKICAgICAgICAgICAgICAgICAgICAvLyBJbiBjYXNlIGl0IGlzIGEgcmVmZXJlbmNlIHRvIGFub3RoZXIgUERGT2JqZWN0LCB0YWtlIHRoZSByZWZlcmVubmNlIG51bWJlcgogICAgICAgICAgICAgICAgICAgIGNvbnRlbnQgKz0gJy8nICsga2V5ICsgJyAnICsgdmFsdWUub2JqSWQgKyAiIDAgUiIgKyAiXG4iOwogICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICBjb250ZW50ICs9ICcvJyArIGtleSArICcgJyArIHZhbHVlICsgJ1xuJzsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICByZXR1cm4gY29udGVudDsKICAgIH07CgogICAgdmFyIG9iamVjdCA9ICIiOwoKICAgIG9iamV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sIG5hbWUgb2YgdGhlIEZpZWxkIE9iamVjdC4KICAgICAqIEl0IGhhcyB0byBiZSB1bmlxdWUuCiAgICAgKi8KICAgIHZhciBfVDsKCiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkodGhpcywgJ1QnLCB7CiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSwKICAgICAgICBjb25maWd1cmFibGU6IGZhbHNlLAogICAgICAgIHNldDogZnVuY3Rpb24gc2V0KHZhbCkgewogICAgICAgICAgICBfVCA9IHZhbDsKICAgICAgICB9LAogICAgICAgIGdldDogZnVuY3Rpb24gZ2V0KCkgewogICAgICAgICAgICBpZiAoIV9UIHx8IF9ULmxlbmd0aCA8IDEpIHsKICAgICAgICAgICAgICAgIGlmICh0aGlzIGluc3RhbmNlb2YgQWNyb0Zvcm0uQ2hpbGRDbGFzcykgewogICAgICAgICAgICAgICAgICAgIC8vIEluIGNhc2Ugb2YgYSBDaGlsZCBmcm9tIGEgUmFkaW/CtEdyb3VwLCB5b3UgZG9uJ3QgbmVlZCBhIEZpZWxkTmFtZSEhIQogICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHJldHVybiAiKEZpZWxkT2JqZWN0IiArIEFjcm9Gb3JtLkZpZWxkLkZpZWxkTnVtKysgKyAiKSI7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKF9ULnN1YnN0cmluZygwLCAxKSA9PSAiKCIgJiYgX1Quc3Vic3RyaW5nKF9ULmxlbmd0aCAtIDEpKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gX1Q7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuICIoIiArIF9UICsgIikiOwogICAgICAgIH0KICAgIH0pOwoKICAgIHZhciBfREE7CiAgICAvLyBEZWZpbmVzIHRoZSBkZWZhdWx0IGFwcGVhcmFuY2UgKE5lZWRlZCBmb3IgdmFyaWFibGUgVGV4dCkKICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eSh0aGlzLCAnREEnLCB7CiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSwKICAgICAgICBnZXQ6IGZ1bmN0aW9uIGdldCgpIHsKICAgICAgICAgICAgaWYgKCFfREEpIHsKICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gJygnICsgX0RBICsgJyknOwogICAgICAgIH0sCiAgICAgICAgc2V0OiBmdW5jdGlvbiBzZXQodmFsKSB7CiAgICAgICAgICAgIF9EQSA9IHZhbDsKICAgICAgICB9CiAgICB9KTsKCiAgICB2YXIgX0RWOwogICAgLy8gRGVmaW5lcyB0aGUgZGVmYXVsdCB2YWx1ZQogICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KHRoaXMsICdEVicsIHsKICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLAogICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZSwKICAgICAgICBnZXQ6IGZ1bmN0aW9uIGdldCgpIHsKICAgICAgICAgICAgaWYgKCFfRFYpIHsKICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gX0RWOwogICAgICAgIH0sCiAgICAgICAgc2V0OiBmdW5jdGlvbiBzZXQodmFsKSB7CiAgICAgICAgICAgIF9EViA9IHZhbDsKICAgICAgICB9CiAgICB9KTsKCiAgICAvL3RoaXMuVHlwZSA9ICIvQW5ub3QiOwogICAgLy90aGlzLlN1YnR5cGUgPSAiL1dpZGdldCI7CiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkodGhpcywgJ1R5cGUnLCB7CiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSwKICAgICAgICBnZXQ6IGZ1bmN0aW9uIGdldCgpIHsKICAgICAgICAgICAgcmV0dXJuIHRoaXMuaGFzQW5ub3RhdGlvbiA/ICIvQW5ub3QiIDogbnVsbDsKICAgICAgICB9CiAgICB9KTsKCiAgICBPYmplY3QuZ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sKCkFjcm9Gb3JtLkNob2ljZUZpZWxkID0gZnVuY3Rpb24gKCkgewogICAgQWNyb0Zvcm0uRmllbGQuY2FsbCh0aGlzKTsKICAgIC8vIEZpZWxkIFR5cGUgPSBDaG9pY2UgRmllbGQKICAgIHRoaXMuRlQgPSAiL0NoIjsKICAgIC8vIG9wdGlvbnMKICAgIHRoaXMuT3B0ID0gW107CiAgICB0aGlzLlYgPSAnKCknOwogICAgLy8gVG9wIEluZGV4CiAgICB0aGlzLlRJID0gMDsKICAgIC8qKgogICAgICogRGVmaW5lcywgd2hldGhlciB0aGUKICAgICAqIEB0eXBlIHtib29sZWFufQogICAgICovCiAgICB0aGlzLmNvbWJvID0gZmFsc2U7CiAgICAvKioKICAgICAqIERlZmluZXMsIHdoZXRoZXIgdGhlIENob2ljZSBGaWVsZCBpcyBhbiBFZGl0IEZpZWxkLgogICAgICogQW4gRWRpdCBGaWVsZCBpcyBhdXRvbWF0aWNhbGx5IGFuIENvbWJvIEZpZWxkLgogICAgICovCiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkodGhpcywgJ2VkaXQnLCB7CiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSwKICAgICAgICBzZXQ6IGZ1bmN0aW9uIHNldCh2YWwpIHsKICAgICAgICAgICAgaWYgKHZhbCA9PSB0cnVlKSB7CiAgICAgICAgICAgICAgICB0aGlzLl9lZGl0ID0gdHJ1ZTsKICAgICAgICAgICAgICAgIC8vIENvbWJvQm94IGhhcyB0byBiZSB0cnVlCiAgICAgICAgICAgICAgICB0aGlzLmNvbWJvID0gdHJ1ZTsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIHRoaXMuX2VkaXQgPSBmYWxzZTsKICAgICAgICAgICAgfQogICAgICAgIH0sCiAgICAgICAgZ2V0OiBmdW5jdGlvbiBnZXQoKSB7CiAgICAgICAgICAgIGlmICghdGhpcy5fZWRpdCkgewogICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogIC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BpZiAoX0RWKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gIigiICsgX0RWICsgIikiOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIF9EVjsKICAgICAgICAgICAgfQogICAgICAgIH0sCiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSwKICAgICAgICBzZXQ6IGZ1bmN0aW9uIHNldCh2YWwpIHsKICAgICAgICAgICAgX0RWID0gdmFsOwogICAgICAgIH0KICAgIH0pOwoKICAgIHZhciBfbXVsdGlsaW5lID0gZmFsc2U7CiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkodGhpcywgJ211bHRpbGluZScsIHsKICAgICAgICBlbnVtZXJhYmxlOiBmYWxzZSwKICAgICAgICBnZXQ6IGZ1bmN0aW9uIGdldCgpIHsKICAgICAgICAgICAgcmV0dXJuIF9tdWx0aWxpbmU7CiAgICAgICAgfSwKICAgICAgICBzZXQ6IGZ1bmN0aW9uIHNldCh2YWwpIHsKICAgICAgICAgICAgX211bHRpbGluZSA9IHZhbDsKICAgICAgICB9CiAgICB9KTsKCiAgICAvL3RoaXMubXVsdGlsaW5lID0gZmFsc2U7CiAgICAvL3RoaXMucGFzc3dvcmQgPSBmYWxzZTsKICAgIC8qKgogICAgICogRm9yIFBERiAxLjQKICAgICAqIEB0eXBlIHtib29sZWFufQogICAgICovCiAgICAvL3RoaXMuZmlsZVNlbGVjdCA9IGZhbHNlOwogICAgLyoqCiAgICAgKiBGb3IgUERGIDEuNAogICAgICogQHR5cGUge2Jvb2xlYW59CiAgICAgKi8KICAgIC8vdGhpcy5kb05vdFNwZWxsQ2hlY2sgPSBmYWxzZTsKICAgIC8qKgogICAgICogRm9yIFBERiAxLjQKICAgICAqIEB0eXBlIHtib29sZWFufQogICAgICovCiAgICAvL3RoaXMuZG9Ob3RTY3JvbGwgPSBmYWxzZTsKCiAgICB2YXIgX01heExlbiA9IGZhbHNlOwogICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KH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VGb250U3BhY2UoIjMiLCBmb250U2l6ZSArICJweCIsIGZvbnQpLmhlaWdodDsKICAgICAgICB2YXIgc3RhcnRZID0gZm9ybU9iamVjdC5tdWx0aWxpbmUgPyBoZWlnaHQgLSBmb250U2l6ZSA6IChoZWlnaHQgLSB0ZXh0SGVpZ2h0KSAvIDI7CiAgICAgICAgc3RhcnRZICs9IGxpbmVTcGFjaW5nOwogICAgICAgIHZhciBzdGFydFggPSAtYm9yZGVyUGFkZGluZzsKCiAgICAgICAgdmFyIGxhc3RYID0gc3RhcnRYLAogICAgICAgICAgICBsYXN0WSA9IHN0YXJ0WTsKICAgICAgICB2YXIgZmlyc3RXb3JkSW5MaW5lID0gMCwKICAgICAgICAgICAgbGFzdFdvcmRJbkxpbmUgPSAwOwogICAgICAgIHZhciBsYXN0TGVuZ3RoID0gMDsKCiAgICAgICAgdmFyIHkgPSAwOwogICAgICAgIGlmIChmb250U2l6ZSA9PSAwKSB7CiAgICAgICAgICAgIC8vIEluIGNhc2UsIHRoZSBUZXh0IGRvZXNuJ3QgZml0IGF0IGFsbAogICAgICAgICAgICBmb250U2l6ZSA9IDEyOwogICAgICAgICAgICB0ZXh0ID0gIiguLi4pIFRqXG4iOwogICAgICAgICAgICB0ZXh0ICs9ICIlIFdpZHRoIG9mIFRleHQ6ICIgKyBBY3JvRm9ybS5pbnRlcm5hbC5jYWxjdWxhdGVGb250U3BhY2UodGV4dCwgIjFweCIpLndpZHRoICsgIiwgRmllbGRXaWR0aDoiICsgd2lkdGggKyAiXG4iOwogICAgICAgICAgICBicmVhazsKICAgICAgICB9CgogICAgICAgIGxhc3RMZW5ndGggPSBBY3JvRm9ybS5pbnRlcm5hbC5jYWxjdWxhdGVGb250U3BhY2UodGV4dFNwbGl0WzBdICsgIiAiLCBmb250U2l6ZSArICJweCIsIGZvbnQpLndpZHRoOwoKICAgICAgICB2YXIgbGFzdExpbmUgPSAiIjsKICAgICAgICB2YXIgbGluZUNvdW50ID0gMDsKICAgICAgICBMaW5lOiBmb3IgKHZhciBpIGluIHRleHRTcGxpdCkgewogICAgICAgICAgICBsYXN0TGluZSArPSB0ZXh0U3BsaXRbaV0gKyAiICI7CiAgICAgICAgICAgIC8vIFJlbW92ZSBsYXN0IGJsYW5rCiAgICAgICAgICAgIGxhc3RMaW5lID0gbGFzdExpbmUuc3Vic3RyKGxhc3RMaW5lLmxlbmd0aCAtIDEpID09ICIgIiA/IGxhc3RMaW5lLnN1YnN0cigwLCBsYXN0TGluZS5sZW5ndGggLSAxKSA6IGxhc3RMaW5lOwogICAgICAgICAgICB2YXIga2V5ID0gcGFyc2VJbnQoaSk7CiAgICAgICAgICAgIGxhc3RMZW5ndGggPSBBY3JvRm9ybS5pbnRlcm5hbC5jYWxjdWxhdGVGb250U3BhY2UobGFzdExpbmUgKyAiICIsIGZvbnRTaXplICsgInB4IiwgZm9udCkud2lkdGg7CiAgICAgICAgICAgIHZhciBuZXh0TGluZUlzU21hbGxlciA9IGlzU21hbGxlclRoYW5XaWR0aChrZXksIGxhc3RMaW5lLCBmb250U2l6ZSk7CiAgICAgICAgICAgIHZhciBpc0xhc3RXb3JkID0gaSA+PSB0ZXh0U3BsaXQubGVuZ3RoIC0gMTsKICAgICAgICAgICAgaWYgKG5leHRMaW5lSXNTbWFsbGVyICYmICFpc0xhc3RXb3JkKSB7CiAgICAgICAgICAgICAgICBsYXN0TGluZSArPSAiICI7CiAgICAgICAgICAgICAgICBjb250aW51ZTsgLy8gTGluZQogICAgICAgICAgICB9IGVsc2UgaWYgKCFuZXh0TGluZUlzU21hbGxlciAmJiAhaXNMYXN0V29yZCkgewogICAgICAgICAgICAgICAgaWYgKCFmb3JtT2JqZWN0Lm11bHRpbGluZSkgewogICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlIEZvbnRTaXplOwogICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICBpZiAoKHRleHRIZWlnaHQgKyBsaW5lU3BhY2luZykgKiAobGluZUNvdW50ICsgMikgKyBsaW5lU3BhY2luZyA+IGhlaWdodCkgewogICAgICAgICAgICAgICAgICAgICAgICAvLyBJZiB0aGUgVGV4dCBpcyBoaWdoZXIgdGhhbiB0aGUgRmllbGRPYmplY3QKICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWUgRm9udFNpemU7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIGxhc3RXb3JkSW5MaW5lID0ga2V5OwogICAgICAgICAgICAgICAgICAgIC8vIGdvIG9uCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0gZWxzZSBpZiAoaXNMYXN0V29yZCkgewogICAgICAgICAgICAgICAgbGFzdFdvcmRJbkxpbmUgPSBrZXk7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBpZiAoZm9ybU9iamVjdC5tdWx0aWxpbmUgJiYgKHRleHRIZWlnaHQgKyBsaW5lU3BhY2luZykgKiAobGluZUNvdW50ICsgMikgKyBsaW5lU3BhY2luZyA+IGhlaWdodCkgewogICAgICAgICAgICAgICAgICAgIC8vIElmIHRoZSBUZXh0IGlzIGhpZ2hlciB0aGFuIHRoZSBGaWVsZE9iamVjdAogICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlIEZvbnRTaXplOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CgogICAgICAgICAgICB2YXIgbGluZSA9ICcnOwoKICAgICAgICAgICAgZm9yICh2YXIgeCA9IGZpcnN0V29yZEluTGluZTsgeCA8PSBsYXN0V29yZEluTGluZTsgeCsrKSB7CiAgICAgICAgICAgICAgICBsaW5lICs9IHRleHRTcGxpdFt4XSArICcgJzsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgLy8gUmVtb3ZlIGxhc3QgYmxhbmsKICAgICAgICAgICAgbGluZSA9IGxpbmUuc3Vic3RyKGxpbmUubGVuZ3RoIC0gMSkgPT0gIiAiID8gbGluZS5zdWJzdHIoMCwgbGluZS5sZW5ndGggLSAxKSA6IGxpbmU7CiAgICAgICAgICAgIC8vbGFzdExlbmd0aCAtPSBibGFua1NwYWNlLndpZHRoOwogICAgICAgICAgICBsYXN0TGVuZ3RoID0gQWNyb0Zvcm0uaW50ZXJuYWwuY2FsY3VsYXRlRm9udFNwYWNlKGxpbmUsIGZvbnRTaXplICsgInB4IiwgZm9udCkud2lkdGg7CgogICAgICAgICAgICAvLyBDYWxjdWxhdGUgc3RhcnRYCiAgICAgICAgICAgIHN3aXRjaCAoZm9ybU9iamVjdC5RKSB7CiAgICAgICAgICAgICAgICBjYXNlIDI6CiAgICAgICAgICAgICAgICAgICAgLy8gUmlnaHQganVzdGlmaWVkCiAgICAgICAgICAgICAgICAgICAgc3RhcnRYID0gd2lkdGggLSBsYXN0TGVuZ3RoIC0gYm9yZGVyUGFkZGluZzsKICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgIGNhc2UgMToKICAgICAgICAgICAgICAgICAgICAvLyBRID0gMSA6PSBUZXh0LUFsaWdubWVudDogQ2VudGVyCiAgICAgICAgICAgICAgICAgICAgc3RhcnRYID0gKHdpZHRoIC0gbGFzdExlbmd0aCkgLyAyOwogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgY2FzZSAwOgogICAgICAgICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICAgICAgICBzdGFydFggPSBib3JkZXJQYWRkaW5nOwogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHRleHQgKz0gc3RhcnRYICsgJyAnICsgbGFzdFkgKyAnIFRkXG4nOwogICAgICAgICAgICB0ZXh0ICs9ICcoJyArIGxpbmUgKyAnKSBUalxuJzsKICAgICAgICAgICAgLy8gcmVzZXQgWCBpbiBQREYKICAgICAgICAgICAgdGV4dCArPSAtc3RhcnRYICsgJyAwIFRkXG4nOwoKICAgICAgICAgICAgLy8gQWZ0ZXIgYSBMaW5lLCBhZGp1c3QgeSBwb3NpdGlvbgogICAgICAgICAgICBsYXN0WSA9IC0oZm9udFNpemUgKyBsaW5lU3BhY2luZyk7CiAgICAgICAgICAgIGxhc3RYID0gc3RhcnRYOwoKICAgICAgICAgICAgLy8gUmVzZXQgZm9yIG5leHQgaXRlcmF0aW9uIHN0ZXAKICAgICAgICAgICAgbGFzdExlbmd0aCA9IDA7CiAgICAgICAgICAgIGZpcnN0V29yZEluTGluZSA9IGxhc3RXb3JkSW5MaW5lICsgMTsKICAgICAgICAgICAgbGluZUNvdW50Kys7CgogICAgICAgICAgICBsYXN0TGluZSA9ICIiOwogICAgICAgICAgICBjb250aW51ZSBMaW5lOwogICAgICAgIH0KICAgICAgICBicmVhazsKICAgIH0KCiAgICByZXR1cm5WYWx1ZS50ZXh0ID0gdGV4dDsKICAgIHJldHVyblZhbHVlLmZvbnRTaXplID0gZm9udFNpemU7CgogICAgcmV0dXJuIHJldHVyblZhbHVlOwp9OwoKQWNyb0Zvcm0uaW50ZXJuYWwuY2FsY3VsYXRlQXBwZWFyYW5jZVN0cmVhbSA9IGZ1bmN0aW9uIChmb3JtT2JqZWN0KSB7CiAgICBpZiAoZm9ybU9iamVjdC5hcHBlYXJhbmNlU3RyZWFtQ29udGVudCkgewogICAgICAgIC8vIElmIGFwcGVhcmFuY2VTdHJlYW0gaXMgYWxyZWFkeSBzZXQsIHVzZSBpdAogICAgICAgIHJldHVybiBmb3JtT2JqZWN0LmFwcGVhcmFuY2VTdHJlYW1Db250ZW50OwogICAgfQoKICAgIGlmICghZm9ybU9iamVjdC5WICYmICFmb3JtT2JqZWN0LkRWKSB7CiAgICAgICAgcmV0dXJuOwogICAgfQoKICAgIC8vIGVsc2UgY2FsY3VsYXRlIGl0CgogICAgdmFyIHN0cmVhbSA9ICcnOwoKICAgIHZhciB0ZXh0ID0gZm9ybU9iamVjdC5WIHx8IGZvcm1PYmplY3QuRFY7CgogICAgdmFyIGNhbGNSZXMgPSBBY3JvRm9ybS5pbnRlcm5hbC5jYWxjdWxhdGVYKG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ogKiAgICAgICAgICAgICAgIDIwMTQgSmFtZXMgSGFsbCwgamFtZXNAcGFyYWxsLmF4CiAqICAgICAgICAgICAgICAgMjAxNCBEaWVnbyBDYXNvcnJhbiwgaHR0cHM6Ly9naXRodWIuY29tL2RpZWdvY3IKICoKICogCiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAqLwoKKGZ1bmN0aW9uIChqc1BERkFQSSkgewogICAgJ3VzZSBzdHJpY3QnOwogICAgLypqc2xpbnQgYnJvd3Nlcjp0cnVlICovCiAgICAvKmdsb2JhbCBkb2N1bWVudDogZmFsc2UsIGpzUERGICovCgogICAgdmFyIGZvbnROYW1lLAogICAgICAgIGZvbnRTaXplLAogICAgICAgIGZvbnRTdHlsZSwKICAgICAgICBwYWRkaW5nID0gMywKICAgICAgICBtYXJnaW4gPSAxMywKICAgICAgICBoZWFkZXJGdW5jdGlvbiwKICAgICAgICBsYXN0Q2VsbFBvcyA9IHsgeDogdW5kZWZpbmVkLCB5OiB1bmRlZmluZWQsIHc6IHVuZGVmaW5lZCwgaDogdW5kZWZpbmVkLCBsbjogdW5kZWZpbmVkIH0sCiAgICAgICAgcGFnZXMgPSAxLAogICAgICAgIHNldExhc3RDZWxsUG9zaXRpb24gPSBmdW5jdGlvbiBzZXRMYXN0Q2VsbFBvc2l0aW9uKHgsIHksIHcsIGgsIGxuKSB7CiAgICAgICAgbGFzdENlbGxQb3MgPSB7ICd4JzogeCwgJ3knOiB5LCAndyc6IHcsICdoJzogaCwgJ2xuJzogbG4gfTsKICAgIH0sCiAgICAgICAgZ2V0TGFzdENlbGxQb3NpdGlvbiA9IGZ1bmN0aW9uIGdldExhc3RDZWxsUG9zaXRpb24oKSB7CiAgICAgICAgcmV0dXJuIGxhc3RDZWxsUG9zOwogICAgfSwKICAgICAgICBOT19NQVJHSU5TID0geyBsZWZ0OiAwLCB0b3A6IDAsIGJvdHRvbTogMCB9OwoKIC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N0Q2VsbFBvc2l0aW9uKCk7CiAgICAgICAgdmFyIHBnQWRkZWQgPSBmYWxzZTsKCiAgICAgICAgLy8gSWYgdGhpcyBpcyBub3QgdGhlIGZpcnN0IGNlbGwsIHdlIG11c3QgY2hhbmdlIGl0cyBwb3NpdGlvbgogICAgICAgIGlmIChjdXJDZWxsLmxuICE9PSB1bmRlZmluZWQpIHsKICAgICAgICAgICAgaWYgKGN1ckNlbGwubG4gPT09IGxuKSB7CiAgICAgICAgICAgICAgICAvL1NhbWUgbGluZQogICAgICAgICAgICAgICAgeCA9IGN1ckNlbGwueCArIGN1ckNlbGwudzsKICAgICAgICAgICAgICAgIHkgPSBjdXJDZWxsLnk7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAvL05ldyBsaW5lCiAgICAgICAgICAgICAgICB2YXIgbWFyZ2lucyA9IHRoaXMubWFyZ2lucyB8fCBOT19NQVJHSU5TOwogICAgICAgICAgICAgICAgaWYgKGN1ckNlbGwueSArIGN1ckNlbGwuaCArIGggKyBtYXJnaW4gPj0gdGhpcy5pbnRlcm5hbC5wYWdlU2l6ZS5oZWlnaHQgLSBtYXJnaW5zLmJvdHRvbSkgewogICAgICAgICAgICAgICAgICAgIHRoaXMuY2VsbEFkZFBhZ2UoKTsKICAgICAgICAgICAgICAgICAgICBwZ0FkZGVkID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5wcmludEhlYWRlcnMgJiYgdGhpcy50YWJsZUhlYWRlclJvdykgewogICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnByaW50SGVhZGVyUm93KGxuLCB0cnVlKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAvL1dlIGlnbm9yZSB0aGUgcGFzc2VkIHk6IHRoZSBsaW5lcyBtYXkgaGF2ZSBkaWZmZXJlbnQgaGVpZ2h0cwogICAgICAgICAgICAgICAgeSA9IGdldExhc3RDZWxsUG9zaXRpb24oKS55ICsgZ2V0TGFzdENlbGxQb3NpdGlvbigpLmg7CiAgICAgICAgICAgICAgICBpZiAocGdBZGRlZCkgeSA9IG1hcmdpbiArIDEwOwogICAgICAgICAgICB9CiAgICAgICAgfQoKICAgICAgICBpZiAodHh0WzBdICE9PSB1bmRlZmluZWQpIHsKICAgICAgICAgICAgaWYgKHRoaXMucHJpbnRpbmdIZWFkZXJSb3cpIHsKICAgICAgICAgICAgICAgIHRoaXMucmVjdCh4LCB5LCB3LCBoLCAnRkQnKTsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIHRoaXMucmVjdCh4LCB5LCB3LCBoKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBpZiAoYWxpZ24gPT09ICdyaWdodCcpIHsKICAgICAgICAgICAgICAgIGlmICghKHR4dCBpbnN0YW5jZW9mIEFycmF5KSkgewogICAgICAgICAgICAgICAgICAgIHR4dCA9IFt0eHRdOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB0eHQubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgICAgICAgICB2YXIgY3VycmVudExpbmUgPSB0eHRbaV07CiAgICAgICAgICAgICAgICAgICAgdmFyIHRleHRTaXplID0gdGhpcy5nZXRTdHJpbmdVbml0V2lkdGgoY3VycmVudExpbmUpICogdGhpcy5pbnRlcm5hbC5nZXRGb250U2l6ZSgpOwogICAgICAgICAgICAgICAgICAgIHRoaXMudGV4dChjdXJyZW50TGluZSwgeCArIHcgLSB0ZXh0U2l6ZSAtIHBhZGRpbmcsIHkgKyB0aGlzLmludGVybmFsLmdldExpbmVIZWlnaHQoKSAqIChpICsgMSkpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgdGhpcy50ZXh0KHR4dCwgeCArIHBhZGRpbmcsIHkgKyB0aGlzLmludGVybmFsLmdldExpbmVIZWlnaHQoKSk7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgc2V0TGFzdENlbGxQb3NpdGlvbih4LCB5LCB3LCBoLCBsbik7CiAgICAgICAgcmV0dXJuIHRoaXM7CiAgICB9OwoKICAgIC8qKgogICAgICogUmV0dXJuIHRoZSBtYXhpbXVtIHZhbHVlIGZyb20gYW4gYXJyYXkKICAgICAqIEBwYXJhbSBhcnJheQogICAgICogQHBhcmFtIGNvbXBhcmlzb25GbgogICAgICogQHJldHVybnMgeyp9CiAgICAgKi8KICAgIGpzUERGQVBJLmFycmF5TWF4ID0gZnVuY3Rpb24gKGFycmF5LCBjb21wYXJpc29uRm4pIHsKICAgICAgICB2YXIgbWF4ID0gYXJyYXlbMF0sCiAgICAgICAgICAgIGksCiAgICAgICAgICAgIGxuLAogICAgICAgICAgICBpdGVtOwoKICAgICAgICBmb3IgKGkgPSAwLCBsbiA9IGFycmF5Lmxlbmd0aDsgaSA8IGxuOyBpICs9IDEpIHsKICAgICAgICAgICAgaXRlbSA9IGFycmF5W2ldOwoKICAgICAgICAgICAgaWYgKGNvbXBhcmlzb25GbikgewogICAgICAgICAgICAgICAgaWYgKGNvbXBhcmlzb25GbihtYXgsIGl0ZW0pID09PSAtMSkgewogICAgICAgICAgICAgICAgICAgIG1heCA9IGl0ZW07CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBpZiAoaXRlbSA+IG1heCkgewogICAgICAgICAgICAgICAgICAgIG1heCA9IGl0ZW07CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAgIHJldHVybiBtYXg7CiAgICB9OwoKICAgIC8qKgogICAgICogQ3JlYXRlIGEgdGFibGUgZnJvbSBhIHNldCBvZiBkYXRhLgogICAgICogQHBhcmFtIHtJbnRlZ2VyfSBbeF0gOiBsZWZ0LXBvc2l0aW9uIGZvciB0b3AtbGVmdCBjb3JuZXIgb2YgdGFibGUKICAgICAqIEBw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iAgICAgICAgICAgIGhlYWRlclByb21wdHMgPSBbXSwKICAgICAgICAgICAgaGVhZGVyLAogICAgICAgICAgICBpLAogICAgICAgICAgICBsbiwKICAgICAgICAgICAgY2xuLAogICAgICAgICAgICBjb2x1bW5NYXRyaXggPSB7fSwKICAgICAgICAgICAgY29sdW1uV2lkdGhzID0ge30sCiAgICAgICAgICAgIGNvbHVtbkRhdGEsCiAgICAgICAgICAgIGNvbHVtbiwKICAgICAgICAgICAgY29sdW1uTWluV2lkdGhzID0gW10sCiAgICAgICAgICAgIGosCiAgICAgICAgICAgIHRhYmxlSGVhZGVyQ29uZmlncyA9IFtdLAogICAgICAgICAgICBtb2RlbCwKICAgICAgICAgICAgamxuLAogICAgICAgICAgICBmdW5jLAoKCiAgICAgICAgLy9zZXQgdXAgZGVmYXVsdHMuIElmIGEgdmFsdWUgaXMgcHJvdmlkZWQgaW4gY29uZmlnLCBkZWZhdWx0cyB3aWxsIGJlIG92ZXJ3cml0dGVuOgogICAgICAgIGF1dG9TaXplID0gZmFsc2UsCiAgICAgICAgICAgIHByaW50SGVhZGVycyA9IHRydWUsCiAgICAgICAgICAgIGZvbnRTaXplID0gMTIsCiAgICAgICAgICAgIG1hcmdpbnMgPSBOT19NQVJHSU5TOwoKICAgICAgICBtYXJnaW5zLndpZHRoID0gdGhpcy5pbnRlcm5hbC5wYWdlU2l6ZS53aWR0aDsKCiAgICAgICAgaWYgKGNvbmZpZykgewogICAgICAgICAgICAvL292ZXJyaWRlIGNvbmZpZyBkZWZhdWx0cyBpZiB0aGUgdXNlciBoYXMgc3BlY2lmaWVkIG5vbi1kZWZhdWx0IGJlaGF2aW9yOgogICAgICAgICAgICBpZiAoY29uZmlnLmF1dG9TaXplID09PSB0cnVlKSB7CiAgICAgICAgICAgICAgICBhdXRvU2l6ZSA9IHRydWU7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKGNvbmZpZy5wcmludEhlYWRlcnMgPT09IGZhbHNlKSB7CiAgICAgICAgICAgICAgICBwcmludEhlYWRlcnMgPSBmYWxzZTsKICAgICAgICAgICAgfQogICAgICAgICAgICBpZiAoY29uZmlnLmZvbnRTaXplKSB7CiAgICAgICAgICAgICAgICBmb250U2l6ZSA9IGNvbmZpZy5mb250U2l6ZTsKICAgICAgICAgICAgfQogICAgICAgICAgICBpZiAoY29uZmlnLmNzcyAmJiB0eXBlb2YgY29uZmlnLmNzc1snZm9udC1zaXplJ10gIT09ICJ1bmRlZmluZWQiKSB7CiAgICAgICAgICAgICAgICBmb250U2l6ZSA9IGNvbmZpZy5jc3NbJ2ZvbnQtc2l6ZSddICogMTY7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKGNvbmZpZy5tYXJnaW5zKSB7CiAgICAgICAgICAgICAgICBtYXJnaW5zID0gY29uZmlnLm1hcmdpbnM7CiAgICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAgIC8qKgogICAgICAgICAqIEBwcm9wZXJ0eSB7TnVtYmVyfSBsbk1vZAogICAgICAgICAqIEtlZXAgdHJhY2sgb2YgdGhlIGN1cnJlbnQgbGluZSBudW1iZXIgbW9kaWZpZXIgdXNlZCB3aGVuIGNyZWF0aW5nIGNlbGxzCiAgICAgICAgICovCiAgICAgICAgdGhpcy5sbk1vZCA9IDA7CiAgICAgICAgbGFzdENlbGxQb3MgPSB7IHg6IHVuZGVmaW5lZCwgeTogdW5kZWZpbmVkLCB3OiB1bmRlZmluZWQsIGg6IHVuZGVmaW5lZCwgbG46IHVuZGVmaW5lZCB9LCBwYWdlcyA9IDE7CgogICAgICAgIHRoaXMucHJpbnRIZWFkZXJzID0gcHJpbnRIZWFkZXJzOwogICAgICAgIHRoaXMubWFyZ2lucyA9IG1hcmdpbnM7CiAgICAgICAgdGhpcy5zZXRGb250U2l6ZShmb250U2l6ZSk7CiAgICAgICAgdGhpcy50YWJsZV9mb250X3NpemUgPSBmb250U2l6ZTsKCiAgICAgICAgLy8gU2V0IGhlYWRlciB2YWx1ZXMKICAgICAgICBp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ByZWNbaGVhZGVyXTsKICAgICAgICAgICAgfTsKCiAgICAgICAgICAgIGZvciAoaSA9IDAsIGxuID0gaGVhZGVyTmFtZXMubGVuZ3RoOyBpIDwgbG47IGkgKz0gMSkgewogICAgICAgICAgICAgICAgaGVhZGVyID0gaGVhZGVyTmFtZXNbaV07CgogICAgICAgICAgICAgICAgY29sdW1uTWF0cml4W2hlYWRlcl0gPSBkYXRhLm1hcChmdW5jKTsKCiAgICAgICAgICAgICAgICAvLyBnZXQgaGVhZGVyIHdpZHRoCiAgICAgICAgICAgICAgICBjb2x1bW5NaW5XaWR0aHMucHVzaCh0aGlzLmdldFRleHREaW1lbnNpb25zKGhlYWRlclByb21wdHNbaV0gfHwgaGVhZGVyKS53KTsKICAgICAgICAgICAgICAgIGNvbHVtbiA9IGNvbHVtbk1hdHJpeFtoZWFkZXJdOwoKICAgICAgICAgICAgICAgIC8vIGdldCBjZWxsIHdpZHRocwogICAgICAgICAgICAgICAgZm9yIChqID0gMCwgY2xuID0gY29sdW1uLmxlbmd0aDsgaiA8IGNsbjsgaiArPSAxKSB7CiAgICAgICAgICAgICAgICAgICAgY29sdW1uRGF0YSA9IGNvbHVtbltqXTsKICAgICAgICAgICAgICAgICAgICBjb2x1bW5NaW5XaWR0aHMucHVzaCh0aGlzLmdldFRleHREaW1lbnNpb25zKGNvbHVtbkRhdGEpLncpOwogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgIC8vIGdldCBmaW5hbCBjb2x1bW4gd2lkdGgKICAgICAgICAgICAgICAgIGNvbHVtbldpZHRoc1toZWFkZXJdID0ganNQREZBUEkuYXJyYXlNYXgoY29sdW1uTWluV2lkdGhzKTsKCiAgICAgICAgICAgICAgICAvL2hhdmUgdG8gcmVzZXQKICAgICAgICAgICAgICAgIGNvbHVtbk1pbldpZHRocyA9IFtdOwogICAgICAgICAgICB9CiAgICAgICAgfQoKICAgICAgICAvLyAtLSBDb25zdHJ1Y3QgdGhlIHRhYmxlCgogICAgICAgIG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bGluZSBudW1iZXIgdG8gb3V0cHV0IHRoZSBoZWFkZXIgYXQKICAgICAqLwogICAganNQREZBUEkucHJpbnRIZWFkZXJSb3cgPSBmdW5jdGlvbiAobGluZU51bWJlciwgbmV3X3BhZ2UpIHsKICAgICAgICBpZiAoIXRoaXMudGFibGVIZWFkZXJSb3cpIHsKICAgICAgICAgICAgdGhyb3cgJ1Byb3BlcnR5IHRhYmxlSGVhZGVyUm93IGRvZXMgbm90IGV4aXN0Lic7CiAgICAgICAgfQoKICAgICAgICB2YXIgdGFibGVIZWFkZXJDZWxsLCB0bXBBcnJheSwgaSwgbG47CgogICAgICAgIHRoaXMucHJpbnRpbmdIZWFkZXJSb3cgPSB0cnVlOwogICAgICAgIGlmIChoZWFkZXJGdW5jdGlvbiAhPT0gdW5kZWZpbmVkKSB7CiAgICAgICAgICAgIHZhciBwb3NpdGlvbiA9IGhlYWRlckZ1bmN0aW9uKHRoaXMsIHBhZ2VzKTsKICAgICAgICAgICAgc2V0TGFzdENlbGxQb3NpdGlvbihwb3NpdGlvblswXSwgcG9zaXRpb25bMV0sIHBvc2l0aW9uWzJdLCBwb3NpdGlvblszXSwgLTEpOwogICAgICAgIH0KICAgICAgICB0aGlzLnNldEZvbnRTdHlsZSgnYm9sZCcpOwogICAgICAgIHZhciB0ZW1wSGVhZGVyQ29uZiA9IFtdOwogICAgICAgIGZvciAoaSA9IDAsIGxuID0gdGhpcy50YWJsZUhlYWRlclJvdy5sZW5ndGg7IGkgPCBsbjsgaSArPSAxKSB7CiAgICAgICAgICAgIHRoaXMuc2V0RmlsbENvbG9yKDIwMCwgMjAwLCAyMDApOwoKICAgICAgICAgICAgdGFibGVIZWFkZXJDZWxsID0gdGhpcy50YWJsZUhlYWRlclJvd1tpXTsKICAgICAgICAgICAgaWYgKG5ld19wYWdlKSB7CiAgICAgICAgICAgICAgICB0aGlzLm1hcmdpbnMudG9wID0gbWFyZ2luOwogICAgICAgICAgICAgICAgdGFibGVIZWFkZXJDZWxsWzF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Y3Rpb24gc2F2ZSgpIHsKICAgICAgICAgICAgdGhpcy5jdHguX2ZvbnRTaXplID0gdGhpcy5wZGYuaW50ZXJuYWwuZ2V0Rm9udFNpemUoKTsKICAgICAgICAgICAgdmFyIGN0eCA9IG5ldyBjb250ZXh0KCk7CiAgICAgICAgICAgIGN0eC5jb3B5KHRoaXMuY3R4KTsKICAgICAgICAgICAgdGhpcy5jdHhTdGFjay5wdXNoKHRoaXMuY3R4KTsKICAgICAgICAgICAgdGhpcy5jdHggPSBjdHg7CiAgICAgICAgfSwKCiAgICAgICAgcmVzdG9yZTogZnVuY3Rpb24gcmVzdG9yZSgpIHsKICAgICAgICAgICAgdGhpcy5jdHggPSB0aGlzLmN0eFN0YWNrLnBvcCgpOwogICAgICAgICAgICB0aGlzLnNldEZpbGxTdHlsZSh0aGlzLmN0eC5maWxsU3R5bGUpOwogICAgICAgICAgICB0aGlzLnNldFN0cm9rZVN0eWxlKHRoaXMuY3R4LnN0cm9rZVN0eWxlKTsKICAgICAgICAgICAgdGhpcy5zZXRGb250KHRoaXMuY3R4LmZvbnQpOwogICAgICAgICAgICB0aGlzLnBkZi5zZXRGb250U2l6ZSh0aGlzLmN0eC5fZm9udFNpemUpOwogICAgICAgICAgICB0aGlzLnNldExpbmVDYXAodGhpcy5jdHgubGluZUNhcCk7CiAgICAgICAgICAgIHRoaXMuc2V0TGluZVdpZHRoKHRoaXMuY3R4LmxpbmVXaWR0aCk7CiAgICAgICAgICAgIHRoaXMuc2V0TGluZUpvaW4odGhpcy5jdHgubGluZUpvaW4pOwogICAgICAgIH0sCgogICAgICAgIHJlY3Q6IGZ1bmN0aW9uIHJlY3QoeCwgeSwgdywgaCkgewogICAgICAgICAgICB0aGlzLm1vdmVUbyh4LCB5KTsKICAgICAgICAgICAgdGhpcy5saW5lVG8oeCArIHcsIHkpOwogICAgICAgICAgICB0aGlzLmxpbmVUbyh4ICsgdywgeSArIGgpOwogICAgICAgICAgICB0aGlzLmxpbmVUbyh4LCB5ICsgaCk7CiAgICAgICAgICAgIHRoaXMubGluZVRvKHgsIHkpOyAvL1RPRE8gbm90IG5lZWRlZAogICAgICAgICAgICB0aGlzLmNsb3NlUGF0aCgpOwogICAgICAgIH0sCgogICAgICAgIGJlZ2luUGF0aDogZnVuY3Rpb24gYmVnaW5QYXRoKCkgewogICAgICAgICAgICB0aGlzLnBhdGggPSBbXTsKICAgICAgICB9LAoKICAgICAgICBjbG9zZVBhdGg6IGZ1bmN0aW9uIGNsb3NlUGF0aCgpIHsKICAgICAgICAgICAgdGhpcy5wYXRoLnB1c2goewogICAgICAgICAgICAgICAgdHlwZTogJ2Nsb3NlJwogICAgICAgICAgICB9KTsKICAgICAgICB9LAoKICAgICAgICBfZ2V0UmdiYTogZnVuY3Rpb24gX2dldFJnYmEoc3R5bGUpIHsKICAgICAgICAgICAgLy8gZ2V0IHRoZSBkZWNpbWFsIHZhbHVlcyBvZiByLCBnLCBhbmQgYjsKICAgICAgICAgICAgdmFyIHJnYmEgPSB7fTsKCiAgICAgICAgICAgIGlmICh0aGlzLmludGVybmFsLnJ4VHJhbnNwYXJlbnQudGVzdChzdHlsZSkpIHsKICAgICAgICAgICAgICAgIHJnYmEuciA9IDA7CiAgICAgICAgICAgICAgICByZ2JhLmcgPSAwOwogICAgICAgICAgICAgICAgcmdiYS5iID0gMDsKICAgICAgICAgICAgICAgIHJnYmEuYSA9IDA7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICB2YXIgbSA9IHRoaXMuaW50ZXJuYWwucnhSZ2IuZXhlYyhzdHlsZSk7CiAgICAgICAgICAgICAgICBpZiAobSAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgcmdiYS5yID0gcGFyc2VJbnQobVsxXSk7CiAgICAgICAgICAgICAgICAgICAgcmdiYS5nID0gcGFyc2VJbnQobVsyXSk7CiAgICAgICAgICAgICAgICAgICAgcmdiYS5iID0gcGFyc2VJbnQobVszXSk7CiAgICAgICAgICAgICAgICAgICAgcmdiYS5hID0gMTsKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgbSA9IHRoaXMuaW50ZXJuYWwucnhSZ2JhLmV4ZWMoc3R5bGUpOwogICAgICAgICAgICAgICAgICAgIGlmIChtICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgcmdiYS5yID0gcGFyc2VJbnQobVsxXSk7CiAgICAgICAgICAgICAgICAgICAgICAgIHJnYmEuZyA9IHBhcnNlSW50KG1bMl0pOwogICAgICAgICAgICAgICAgICAgICAgICByZ2JhLmIgPSBwYXJzZUludChtWzNdKTsKICAgICAgICAgICAgICAgICAgICAgICAgcmdiYS5hID0gcGFyc2VGbG9hdChtWzRdKTsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICByZ2JhLmEgPSAxOwogICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3R5bGUuY2hhckF0KDApICE9ICcjJykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgc3R5bGUgPSBDc3NDb2xvcnMuY29sb3JOYW1lVG9IZXgoc3R5bGUpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFzdHlsZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0eWxlID0gJyMwMDAwMDAnOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge30KCiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdHlsZS5sZW5ndGggPT09IDQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJnYmEuciA9IHN0eWxlLnN1YnN0cmluZygxLCAyKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJnYmEuciArPSByOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcmdiYS5nID0gc3R5bGUuc3Vic3RyaW5nKDIsIDMpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcmdiYS5nICs9IGc7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZ2JhLmIgPSBzdHlsZS5zdWJzdHJpbmcoMywgNCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZ2JhLmIgKz0gYjsKICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJnYmEuciA9IHN0eWxlLnN1YnN0cmluZygxLCAzKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJnYmEuZyA9IHN0eWxlLnN1YnN0cmluZygzLCA1KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJnYmEuYiA9IHN0eWxlLnN1YnN0cmluZyg1LCA3KTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICByZ2JhLnIgPSBwYXJzZUludChyZ2JhLnIsIDE2KTsKICAgICAgICAgICAgICAgICAgICAgICAgcmdiYS5nID0gcGFyc2VJbnQocmdiYS5nLCAxNik7CiAgICAgICAgICAgICAgICAgICAgICAgIHJnYmEuYiA9IHBhcnNlSW50KHJnYmEuYiwgMTYpOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICByZ2JhLnN0eWxlID0gc3R5bGU7CiAgICAgICAgICAgIHJldHVybiByZ2JhOwogICAgICAgIH0sCgogICAgICAgIHNldEZpbGxTdHlsZTogZnVuY3Rpb24gc2V0RmlsbFN0eWxlKHN0eWxlKSB7CiAgICAgICAgICAgIC8vIGdldCB0aGUgZGVjaW1hbCB2YWx1ZXMgb2YgciwgZywgYW5kIGI7CiAgICAgICAgICAgIHZhciByLCBnLCBiLCBhOwoKICAgICAgICAgICAgaWYgKHRoaXMuaW50ZXJuYWwucnhUcmFuc3BhcmVudC50ZXN0KHN0eWxlKSkgewogICAgICAgICAgICAgICAgciA9IDA7CiAgICAgICAgICAgICAgICBnID0gMDsKICAgICAgICAgICAgICAgIGIgPSAwOwogICAgICAgICAgICAgICAgYSA9IDA7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICB2YXIgbSA9IHRoaXMuaW50ZXJuYWwucnhSZ2IuZXhlYyhzdHlsZSk7CiAgICAgICAgICAgICAgICBpZiAobSAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgciA9IHBhcnNlSW50KG1bMV0pOwogICAgICAgICAgICAgICAgICAgIGcgPSBwYXJzZUludChtWzJdKTsKICAgICAgICAgICAgICAgICAgICBiID0gcGFyc2VJbnQobVszXSk7CiAgICAgICAgICAgICAgICAgICAgYSA9IDE7CiAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgIG0gPSB0aGlzLmludGVybmFsLnJ4UmdiYS5leGVjKHN0eWxlKTsKICAgICAgICAgICAgICAgICAgICBpZiAobSAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHIgPSBwYXJzZUludChtWzFdKTsKICAgICAgICAgICAgICAgICAgICAgICAgZyA9IHBhcnNlSW50KG1bMl0pOwogICAgICAgICAgICAgICAgICAgICAgICBiID0gcGFyc2VJbnQobVszXSk7CiAgICAgICAgICAgICAgICAgICAgICAgIGEgPSBwYXJzZUZsb2F0KG1bNF0pOwogICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGEgPSAxOwogICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3R5bGUuY2hhckF0KDApICE9ICcjJykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgc3R5bGUgPSBDc3NDb2xvcnMuY29sb3JOYW1lVG9IZXgoc3R5bGUpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFzdHlsZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0eWxlID0gJyMwMDAwMDAnOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge30KCiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdHlsZS5sZW5ndGggPT09IDQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPSBzdHlsZS5zdWJzdHJpbmcoMSwgMik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICByICs9IHI7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gc3R5bGUuc3Vic3RyaW5nKDIsIDMpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgZyArPSBnOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYiA9IHN0eWxlLnN1YnN0cmluZygzLCA0KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIgKz0gYjsKICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIgPSBzdHlsZS5zdWJzdHJpbmcoMSwgMyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBnID0gc3R5bGUuc3Vic3RyaW5nKDMsIDUpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYiA9IHN0eWxlLnN1YnN0cmluZyg1LCA3KTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICByID0gcGFyc2VJbnQociwgMTYpOwogICAgICAgICAgICAgICAgICAgICAgICBnID0gcGFyc2VJbnQoZywgMTYpOwogICAgICAgICAgICAgICAgICAgICAgICBiID0gcGFyc2VJbnQoYiwgMTYpOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQoKICAgICAgICAgICAgdGhpcy5jdHguZmlsbFN0eWxlID0gc3R5bGU7CiAgICAgICAgICAgIHRoaXMuY3R4Ll9pc0ZpbGxUcmFuc3BhcmVudCA9IGEgPT0gMDsKICAgICAgICAgICAgdGhpcy5jdHguX2ZpbGxPcGFjaXR5ID0gYTsKCiAgICAgICAgICAgIHRoaXMucGRmLnNldEZpbGxDb2xvcihyLCBnLCBiLCB7CiAgICAgICAgICAgICAgICBhOiBhCiAgICAgICAgICAgIH0pOwogICAgICAgICAgICB0aGlzLnBkZi5zZXRUZXh0Q29sb3IociwgZywgYiwgewogICAgICAgICAgICAgICAgYTogYQogICAgICAgICAgICB9KTsKICAgICAgICB9LAoKICAgICAgICBzZXRTdHJva2VTdHlsZTogZnVuY3Rpb24gc2V0U3Ryb2tlU3R5bGUoc3R5bGUpIHsKICAgICAgICAgICAgdmFyIHJnYmEgPSB0aGlzLl9nZXRSZ2JhKHN0eWxlKTsKCiAgICAgICAgICAgIHRoaXMuY3R4LnN0cm9rZVN0eWxlID0gcmdiYS5zdHlsZTsKICAgICAgICAgICAgdGhpcy5jdHguX2lzU3Ryb2tlVHJhbnNwYXJlbnQgPSByZ2JhLmEgPT0gMDsKICAgICAgICAgICAgdGhpcy5jdHguX3N0cm9rZU9wYWNpdHkgPSByZ2JhLmE7CgogICAgICAgICAgICAvL1RPRE8ganNQREYgdG8gaGFuZGxlIHJnYmEKICAgICAgICAgICAgaWYgKHJnYmEuYSA9PT0gMCkgewogICAgICAgICAgICAgICAgdGhpcy5wZGYuc2V0RHJhd0NvbG9yKDI1NSwgMjU1LCAyNTUpOwogICAgICAgICAgICB9IGVsc2UgaWYgKHJnYmEuYSA9PT0gMSkgewogICAgICAgICAgICAgICAgdGhpcy5wZGYuc2V0RHJhd0NvbG9yKHJnYmEuciwgcmdiYS5nLCByZ2JhLmIpOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgLy90aGlzLnBkZi5zZXREcmF3Q29sb3IocmdiYS5yLCByZ2JhLmcsIHJnYmEuYiwge2E6IHJnYmEuYX0pOwogICAgICAgICAgICAgICAgdGhpcy5wZGYuc2V0RHJhd0NvbG9yKHJnYmEuciwgcmdiYS5nLCByZ2JhLmIpOwogICAgICAgICAgICB9CiAgICAgICAgfSwKCiAgICAgICAgZmlsbFRleHQ6IGZ1bmN0aW9uIGZpbGxUZXh0KHRleHQsIHgsIHksIG1heFdpZHRoKSB7CiAgICAgICAgICAgIGlmICh0aGlzLl9pc0ZpbGxUcmFuc3BhcmVudCgpKSB7CiAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgIH0KICAgICAgICAgICAgeCA9IHRoaXMuX3dyYXBYKHgpOwogICAgICAgICAgICB5ID0gdGhpcy5fd3JhcFkoeSk7CgogICAgICAgICAgICB2YXIgeHB0ID0gdGhpcy5fbWF0cml4X21hcF9wb2ludCh0aGlzLmN0eC5fdHJhbnNmb3JtLCBbeCwgeV0pOwogICAgICAgICAgICB4ID0geHB0WzBdOwogICAgICAgICAgICB5ID0geHB0WzFdOwogICAgICAgICAgICB2YXIgcmFkcyA9IHRoaXMuX21hdHJpeF9yb3RhdGlvbih0aGlzLmN0eC5fdHJhbnNmb3JtKTsKICAgICAgICAgICAgdmFyIGRlZ3MgPSByYWRzICogNTcuMjk1ODsKCiAgICAgICAgICAgIC8vVE9ETyBvbmx5IHB1c2ggdGhlIGNsaXAgaWYgaXQgaGFzIG5vdCBiZWVuIGFwcGxpZWQgdG8gdGhlIGN1cnJlbnQgUERGIGNvbnRleHQKICAgICAgICAgICAgaWYgKHRoaXMuY3R4Ll9jbGlwX3BhdGgubGVuZ3RoID4gMCkgewogICAgICAgICAgICAgICAgdmFyIGxpbmVzOwogICAgICAgICAgICAgICAgaWYgKHdpbmRvdy5vdXRJbnRlcmNlcHQpIHsKICAgICAgICAgICAgICAgICAgICBsaW5lcyA9IHdpbmRvdy5vdXRJbnRlcmNlcHQudHlwZSA9PT0gJ2dyb3VwJyA/IHdpbmRvdy5vdXRJbnRlcmNlcHQuc3RyZWFtIDogd2luZG93Lm91dEludGVyY2VwdDsKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgbGluZXMgPSB0aGlzLnBkZi5pbnRlcm5hbC5wYWdlc1sxXTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGxpbmVzLnB1c2goInEiKTsKICAgICAgICAgICAgICAgIHZhciBvcmlnUGF0aCA9IHRoaXMucGF0aDsKICAgICAgICAgICAgICAgIHRoaXMucGF0aCA9IHRoaXMuY3R4Ll9jbGlwX3BhdGg7CiAgICAgICAgICAgICAgICB0aGlzLmN0eC5fY2xpcF9wYXRoID0gW107CiAgICAgICAgICAgICAgICB0aGlzLl9maWxsKG51bGwsIHRydWUpOwogICAgICAgICAgICAgICAgdGhpcy5jdHguX2NsaXBfcGF0aCA9IHRoaXMucGF0aDsKICAgICAgICAgICAgICAgIHRoaXMucGF0aCA9IG9yaWdQYXRoOwogICAgICAgICAgICB9CgogICAgICAgICAgICB0aGlzLnBkZi50ZXh0KHRleHQsIHgsIHRoaXMuX2dldEJhc2VsaW5lKHkpLCBudWxsLCBkZWdzKTsKCiAgICAgICAgICAgIGlmICh0aGlzLmN0eC5fY2xpcF9wYXRoLmxlbmd0aCA+IDApIHsKICAgICAgICAgICAgICAgIGxpbmVzLnB1c2goJ1EnKTsKICAgICAgICAgICAgfQogICAgICAgIH0sCgogICAgICAgIHN0cm9rZVRleHQ6IGZ1bmN0aW9uIHN0cm9rZVRleHQodGV4dCwgeCwgeSwgbWF4V2lkdGgpIHsKICAgICAgICAgICAgaWYgKHRoaXMuX2lzU3Ryb2tlVHJhbnNwYXJlbnQoKSkgewogICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHggPSB0aGlzLl93cmFwWCh4KTsKICAgICAgICAgICAgeSA9IHRoaXMuX3dyYXBZKHkpOwoKICAgICAgICAgICAgdmFyIHhwdCA9IHRoaXMuX21hdHJpeF9tYXBfcG9pbnQodGhpcy5jdHguX3RyYW5zZm9ybSwgW3gsIHldKTsKICAgICAgICAgICAgeCA9IHhwdFswXTsKICAgICAgICAgICAgeSA9IHhwdFsxXTsKICAgICAgICAgICAgdmFyIHJhZHMgPSB0aGlzLl9tYXRyaXhfcm90YXRpb24odGhpcy5jdHguX3RyYW5zZm9ybSk7CiAgICAgICAgICAgIHZhciBkZWdzID0gcmFkcyAqIDU3LjI5NTg7CgogICAgICAgICAgICAvL1RPRE8gb25seSBwdXNoIHRoZSBjbGlwIGlmIGl0IGhhcyBub3QgYmVlbiBhcHBsaWVkIHRvIHRoZSBjdXJyZW50IFBERiBjb250ZXh0CiAgICAgICAgICAgIGlmICh0aGlzLmN0eC5fY2xpcF9wYXRoLmxlbmd0aCA+IDApIHsKICAgICAgICAgICAgICAgIHZhciBsaW5lczsKICAgICAgICAgICAgICAgIGlmICh3aW5kb3cub3V0SW50ZXJjZXB0KSB7CiAgICAgICAgICAgICAgICAgICAgbGluZXMgPSB3aW5kb3cub3V0SW50ZXJjZXB0LnR5cGUgPT09ICdncm91cCcgPyB3aW5kb3cub3V0SW50ZXJjZXB0LnN0cmVhbSA6IHdpbmRvdy5vdXRJbnRlcmNlcHQ7CiAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgIGxpbmVzID0gdGhpcy5wZGYuaW50ZXJuYWwucGFnZXNbMV07CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBsaW5lcy5wdXNoKCJxIik7CiAgICAgICAgICAgICAgICB2YXIgb3JpZ1BhdGggPSB0aGlzLnBhdGg7CiAgICAgICAgICAgICAgICB0aGlzLnBhdGggPSB0aGlzLmN0eC5fY2xpcF9wYXRoOwogICAgICAgICAgICAgICAgdGhpcy5jdHguX2NsaXBfcGF0aCA9IFtdOwogICAgICAgICAgICAgICAgdGhpcy5fZmlsbChudWxsLCB0cnVlKTsKICAgICAgICAgICAgICAgIHRoaXMuY3R4Ll9jbGlwX3BhdGggPSB0aGlzLnBhdGg7CiAgICAgICAgICAgICAgICB0aGlzLnBhdGggPSBvcmlnUGF0aDsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgdGhpcy5wZGYudGV4dCh0ZXh0LCB4LCB0aGlzLl9nZXRCYXNlbGluZSh5KSwgewogICAgICAgICAgICAgICAgc3Ryb2tlOiB0cnVlCiAgICAgICAgICAgIH0sIGRlZ3MpOwoKICAgICAgICAgICAgaWYgKHRoaXMuY3R4Ll9jbGlwX3BhdGgubGVuZ3RoID4gMCkgewogICAgICAgICAgICAgICAgbGluZXMucHVzaCgnUScpOwogICAgICAgICAgICB9CiAgICAgICAgfSwKCiAgICAgICAgc2V0Rm9udDogZnVuY3Rpb24gc2V0Rm9udChmb250KSB7CiAgICAgICAgICAgIHRoaXMuY3R4LmZvbnQgPSBmb250OwoKICAgICAgICAgICAgLy92YXIgcnggPSAvXHMqKFx3KylccysoXHcrKVxzKyhcdyspXHMrKFtcZFwuXSspKHB4fHB0fGVtKVxzK1siJ10/KFx3KylbJyJdPy87CiAgICAgICAgICAgIHZhciByeCA9IC9ccyooXHcrKVxzKyhcdyspXHMrKFx3KylccysoW1xkXC5dKykocHh8cHR8ZW0pXHMrKC4qKT8vOwogICAgICAgICAgICBtID0gcnguZXhlYyhmb250KTsKICAgICAgICAgICAgaWYgKG0gIT0gbnVsbCkgewogICAgICAgICAgICAgICAgdmFyIGZvbnRTdHlsZSA9IG1bMV07CiAgICAgICAgICAgICAgICB2YXIgZm9udFZhcmlhbnQgPSBtWzJdOwogICAgICAgICAgICAgICAgdmFyIGZvbnRXZWlnaHQgPSBtWzNdOwogICAgICAgICAgICAgICAgdmFyIGZvbnRTaXplID0gbVs0XTsKICAgICAgICAgICAgICAgIHZhciBmb250U2l6ZVVuaXQgPSBtWzVdOwogICAgICAgICAgICAgICAgdmFyIGZvbnRGYW1pbHkgPSBtWzZdOwoKICAgICAgICAgICAgICAgIGlmICgncHgnID09PSBmb250U2l6ZVVuaXQpIHsKICAgICAgICAgICAgICAgICAgICBmb250U2l6ZSA9IE1hdGguZmxvb3IocGFyc2VGbG9hdChmb250U2l6ZSkpOwogICAgICAgICAgICAgICAgICAgIC8vIGZvbnRTaXplID0gZm9udFNpemUgKiAxLjI1OwogICAgICAgICAgICAgICAgfSBlbHNlIGlmICgnZW0nID09PSBmb250U2l6ZVVuaXQpIHsKICAgICAgICAgICAgICAgICAgICBmb250U2l6ZSA9IE1hdGguZmxvb3IocGFyc2VGbG9hdChmb250U2l6ZSkgKiB0aGlzLnBkZi5nZXRGb250U2l6ZSgpKTsKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgZm9udFNpemUgPSBNYXRoLmZsb29yKHBhcnNlRmxvYXQoZm9udFNpemUpKTsKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICB0aGlzLnBkZi5zZXRGb250U2l6ZShmb250U2l6ZSk7CgogICAgICAgICAgICAgICAgaWYgKGZvbnRXZWlnaHQgPT09ICdib2xkJyB8fCBmb250V2VpZ2h0ID09PSAnNzAwJykgewogICAgICAgICAgICAgICAgICAgIHRoaXMucGRmLnNldEZvbnRTdHlsZSgnYm9sZCcpOwogICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICBpZiAoZm9udFN0eWxlID09PSAnaXRhbGljJykgewogICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnBkZi5zZXRGb250U3R5bGUoJ2l0YWxpYycpOwogICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGRmLnNldEZvbnRTdHlsZSgnbm9ybWFsJyk7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgIHZhciBuYW1lID0gZm9udEZhbWlseTsKICAgICAgICAgICAgICAgIHZhciBwYXJ0cyA9IG5hbWUudG9Mb3dlckNhc2UoKS5zcGxpdCgvXHMqLFxzKi8pOwogICAgICAgICAgICAgICAgdmFyIGpzUGRmRm9udE5hbWU7CgogICAgICAgICAgICAgICAgaWYgKHBhcnRzLmluZGV4T2YoJ2FyaWFsJykgIT0gLTEpIHsKICAgICAgICAgICAgICAgICAgICBqc1BkZkZvbnROYW1lID0gJ0FyaWFsJzsKICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocGFydHMuaW5kZXhPZigndmVyZGFuYScpICE9IC0xKSB7CiAgICAgICAgICAgICAgICAgICAganNQZGZGb250TmFtZSA9ICdWZXJkYW5hJzsKICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocGFydHMuaW5kZXhPZignaGVsdmV0aWNhJykgIT0gLTEpIHsKICAgICAgICAgICAgICAgICAgICBqc1BkZkZvbnROYW1lID0gJ0hlbHZldGljYSc7CiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHBhcnRzLmluZGV4T2YoJ3NhbnMtc2VyaWYnKSAhPSAtMSkgewogICAgICAgICAgICAgICAgICAgIGpzUGRmRm9udE5hbWUgPSAnc2Fucy1zZXJpZic7CiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHBhcnRzLmluZGV4T2YoJ2ZpeGVkJykgIT0gLTEpIHsKICAgICAgICAgICAgICAgICAgICBqc1BkZkZvbnROYW1lID0gJ0ZpeGVkJzsKICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocGFydHMuaW5kZXhPZignbW9ub3NwYWNlJykgIT0gLTEpIHsKICAgICAgICAgICAgICAgICAgICBqc1BkZkZvbnROYW1lID0gJ01vbm9zcGFjZSc7CiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHBhcnRzLmluZGV4T2YoJ3Rlcm1pbmFsJykgIT0gLTEpIHsKICAgICAgICAgICAgICAgICAgICBqc1BkZkZvbnROYW1lID0gJ1Rlcm1pbmFsJzsKICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocGFydHMuaW5kZXhPZignY291cmllcicpICE9IC0xKSB7CiAgICAgICAgICAgICAgICAgICAganNQZGZGb250TmFtZSA9ICdDb3VyaWVyJzsKICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocGFydHMuaW5kZXhPZigndGltZXMnKSAhPSAtMSkgewogICAgICAgICAgICAgICAgICAgIGpzUGRmRm9udE5hbWUgPSAnVGltZXMnOwogICAgICAgICAgICAgICAgfSBlbHNlIGlmIChwYXJ0cy5pbmRleE9mKCdjdXJzaXZlJykgIT0gLTEpIHsKICAgICAgICAgICAgICAgICAgICBqc1BkZkZvbnROYW1lID0gJ0N1cnNpdmUnOwogICAgICAgICAgICAgICAgfSBlbHNlIGlmIChwYXJ0cy5pbmRleE9mKCdmYW50YXN5JykgIT0gLTEpIHsKICAgICAgICAgICAgICAgICAgICBqc1BkZkZvbnROYW1lID0gJ0ZhbnRhc3knOwogICAgICAgICAgICAgICAgfSBlbHNlIGlmIChwYXJ0cy5pbmRleE9mKCdzZXJpZicpICE9IC0xKSB7CiAgICAgICAgICAgICAgICAgICAganNQZGZGb250TmFtZSA9ICdTZXJpZic7CiAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgIGpzUGRmRm9udE5hbWUgPSAnU2VyaWYnOwogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgIC8vVE9ETyBjaGVjayBtb3JlIGNhc2VzCiAgICAgICAgICAgICAgICB2YXIgc3R5bGU7CiAgICAgICAgICAgICAgICBpZiAoJ2JvbGQnID09PSBmb250V2VpZ2h0KSB7CiAgICAgICAgICAgICAgICAgICAgc3R5bGUgPSAnYm9sZCc7CiAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgIHN0eWxlID0gJ25vcm1hbCc7CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgdGhpcy5wZGYuc2V0Rm9udChqc1BkZkZvbnROYW1lLCBzdHlsZSk7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICB2YXIgcnggPSAvKFxkKykocHR8cHh8ZW0pXHMrKFx3KylccyooXHcrKT8vOwogICAgICAgICAgICAgICAgdmFyIG0gPSByeC5leGVjKGZvbnQpOwogICAgICAgICAgICAgICAgaWYgKG0gIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgIHZhciBzaXplID0gbVsxXTsKICAgICAgICAgICAgICAgICAgICB2YXIgdW5pdCA9IG1bMl07CiAgICAgICAgICAgICAgICAgICAgdmFyIG5hbWUgPSBtWzNdOwogICAgICAgICAgICAgICAgICAgIHZhciBzdHlsZSA9IG1bNF07CiAgICAgICAgICAgICAgICAgICAgaWYgKCFzdHlsZSkgewogICAgICAgICAgICAgICAgICAgICAgICBzdHlsZSA9ICdub3JtYWwnOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBpZiAoJ2VtJyA9PT0gZm9udFNpemVVbml0KSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHNpemUgPSBNYXRoLmZsb29yKHBhcnNlRmxvYXQoZm9udFNpemUpICogdGhpcy5wZGYuZ2V0Rm9udFNpemUoKSk7CiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZSA9IE1hdGguZmxvb3IocGFyc2VGbG9hdChzaXplKSk7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIHRoaXMucGRmLnNldEZvbnRTaXplKHNpemUpOwogICAgICAgICAgICAgICAgICAgIHRoaXMucGRmLnNldEZvbnQobmFtZSwgc3R5bGUpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgfSwKCiAgICAgICAgc2V0VGV4dEJhc2VsaW5lOiBmdW5jdGlvbiBzZXRUZXh0QmFzZWxpbmUoYmFzZWxpbmUpIHsKICAgICAgICAgICAgdGhpcy5jdHgudGV4dEJhc2VsaW5lID0gYmFzZWxpbmU7CiAgICAgICAgfSwKCiAgICAgICAgZ2V0VGV4dEJhc2VsaW5lOiBmdW5jdGlvbiBnZXRUZXh0QmFzZWxpbmUoKSB7CiAgICAgICAgICAgIHJldHVybiB0aGlzLmN0eC50ZXh0QmFzZWxpbmU7CiAgICAgICAgfSwKCiAgICAgICAgLy9UT0RPIGltcGxlbWVudCB0ZXh0QWxpZ24KICAgICAgICBzZXRUZXh0QWxpZ246IGZ1bmN0aW9uIHNldFRleHRBbGlnbihhbGlnbikgewogICAgICAgICAgICB0aGlzLmN0eC50ZXh0QWxpZ24gPSBhbGlnbjsKICAgICAgICB9LAoKICAgICAgICBnZXRUZXh0QWxpZ246IGZ1bmN0aW9uIGdldFRleHRBbGlnbigpIHsKICAgICAgICAgICAgcmV0dXJuIHRoaXMuY3R4LnRleHRBbGlnbjsKICAgICAgICB9LAoKICAgICAgICBzZXRMaW5lV2lkdGg6IGZ1bmN0aW9uIHNldExpbmVXaWR0aCh3aWR0aCkgewogICAgICAgICAgICB0aGlzLmN0eC5saW5lV2lkdGggPSB3aWR0aDsKICAgICAgICAgICAgdGhpcy5wZGYuc2V0TGluZVdpZHRoKHdpZHRoKTsKICAgICAgICB9LAoKICAgICAgICBzZXRMaW5lQ2FwOiBmdW5jdGlvbiBzZXRMaW5lQ2FwKHN0eWxlKSB7CiAgICAgICAgICAgIHRoaXMuY3R4LmxpbmVDYXAgPSBzdHlsZTsKICAgICAgICAgICAgdGhpcy5wZGYuc2V0TGluZUNhcChzdHlsZSk7CiAgICAgICAgfSwKCiAgICAgICAgc2V0TGluZUpvaW46IGZ1bmN0aW9uIHNldExpbmVKb2luKHN0eWxlKSB7CiAgICAgICAgICAgIHRoaXMuY3R4LmxpbmVKb2luID0gc3R5bGU7CiAgICAgICAgICAgIHRoaXMucGRmLnNldExpbmVKb2luKHN0eWxlKTsKICAgICAgICB9LAoKICAgICAgICBtb3ZlVG86IGZ1bmN0aW9uIG1vdmVUbyh4LCB5KSB7CiAgICAgICAgICAgIHggPSB0aGlzLl93cmFwWCh4KTsKICAgICAgICAgICAgeSA9IHRoaXMuX3dyYXBZKHkpOwoKICAgICAgICAgICAgdmFyIHhwdCA9IHRoaXMuX21hdHJpeF9tYXBfcG9pbnQodGhpcy5jdHguX3RyYW5zZm9ybSwgW3gsIHldKTsKICAgICAgICAgICAgeCA9IHhwdFswXTsKICAgICAgICAgICAgeSA9IHhwdFsxXTsKCiAgICAgICAgICAgIHZhciBvYmogPSB7CiAgICAgICAgICAgICAgICB0eXBlOiAnbXQnLAogICAgICAgICAgICAgICAgeDogeCwKICAgICAgICAgICAgICAgIHk6IHkKICAgICAgICAgICAgfTsKICAgICAgICAgICAgdGhpcy5wYXRoLnB1c2gob2JqKTsKICAgICAgICB9LAoKICAgICAgICBfd3JhcFg6IGZ1bmN0aW9uIF93cmFwWCh4KSB7CiAgICAgICAgICAgIGlmICh0aGlzLnBhZ2VXcmFwWEVuYWJsZWQpIHsKICAgICAgICAgICAgICAgIHJldHVybiB4ICUgdGhpcy5wYWdlV3JhcFg7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICByZXR1cm4geDsKICAgICAgICAgICAgfQogICAgICAgIH0sCgogICAgICAgIF93cmFwWTogZnVuY3Rpb24gX3dyYXBZKHkpIHsKICAgICAgICAgICAgaWYgKHRoaXMucGFnZVdyYXBZRW5hYmxlZCkgewogICAgICAgICAgICAgICAgdGhpcy5fZ290b1BhZ2UodGhpcy5fcGFnZSh5KSk7CiAgICAgICAgICAgICAgICByZXR1cm4gKHkgLSB0aGlzLmxhc3RCcmVhaykgJSB0aGlzLnBhZ2VXcmFwWTsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIHJldHVybiB5OwogICAgICAgICAgICB9CiAgICAgICAgfSwKCiAgICAgICAgdHJhbnNmb3JtOiBmdW5jdGlvbiB0cmFuc2Zvcm0oYSwgYiwgYywgZCwgZSwgZikgewogICAgICAgICAgICAvL1RPRE8gYXBwbHkgdG8gY3VycmVudCB0cmFuc2Zvcm1hdGlvbiBpbnN0ZWFkIG9mIHJlcGxhY2luZwogICAgICAgICAgICB0aGlzLmN0eC5fdHJhbnNmb3JtID0gW2EsIGIsIGMsIGQsIGUsIGZdOwogICAgICAgIH0sCgogICAgICAgIHNldFRyYW5zZm9ybTogZnVuY3Rpb24gc2V0VHJhbnNmb3JtKGEsIGIsIGMsIGQsIGUsIGYpIHsKICAgICAgICAgICAgdGhpcy5jdHguX3RyYW5zZm9ybSA9IFthLCBiLCBjLCBkLCBlLCBmXTsKICAgICAgICB9LAoKICAgICAgICBfZ2V0VHJhbnNmb3JtOiBmdW5jdGlvbiBfZ2V0VHJhbnNmb3JtKCkgewogICAgICAgICAgICByZXR1cm4gdGhpcy5jdHguX3RyYW5zZm9ybTsKICAgICAgICB9LAoKICAgICAgICBsYXN0QnJlYWs6IDAsCiAgICAgICAgLy8gWSBQb3NpdGlvbiBvZiBwYWdlIGJyZWFrcy4KICAgICAgICBwYWdlQnJlYWtzOiBbXSwKICAgICAgICAvLyByZXR1cm5zOiBPbmUtYmFzZWQgUGFnZSBOdW1iZXIKICAgICAgICAvLyBTaG91bGQgb25seSBiZSB1c2VkIGlmIHBhZ2VXcmFwWUVuYWJsZWQgaXMgdHJ1ZQogICAgICAgIF9wYWdlOiBmdW5jdGlvbiBfcGFnZSh5KSB7CiAgICAgICAgICAgIGlmICh0aGlzLnBhZ2VXcmFwWUVuYWJsZWQpIHsKICAgICAgICAgICAgICAgIHRoaXMubGFzdEJyZWFrID0gMDsKICAgICAgICAgICAgICAgIHZhciBtYW51YWxCcmVha3MgPSAwOwogICAgICAgICAgICAgICAgdmFyIGF1dG9CcmVha3MgPSAwOwogICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB0aGlzLnBhZ2VCcmVha3MubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgICAgICAgICBpZiAoeSA+PSB0aGlzLnBhZ2VCcmVha3NbaV0pIHsKICAgICAgICAgICAgICAgICAgICAgICAgbWFudWFsQnJlYWtzKys7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLmxhc3RCcmVhayA9PT0gMCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgYXV0b0JyZWFrcysrOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzcGFjZUJldHdlZW5MYXN0QnJlYWsgPSB0aGlzLnBhZ2VCcmVha3NbaV0gLSB0aGlzLmxhc3RCcmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5sYXN0QnJlYWsgPSB0aGlzLnBhZ2VCcmVha3NbaV07CiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwYWdlc1NpbmNlTGFzdEJyZWFrID0gTWF0aC5mbG9vcihzcGFjZUJldHdlZW5MYXN0QnJlYWsgLyB0aGlzLnBhZ2VXcmFwWSk7CiAgICAgICAgICAgICAgICAgICAgICAgIGF1dG9CcmVha3MgKz0gcGFnZXNTaW5jZUxhc3RCcmVhazsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBpZiAodGhpcy5sYXN0QnJlYWsgPT09IDApIHsKICAgICAgICAgICAgICAgICAgICB2YXIgcGFnZXNTaW5jZUxhc3RCcmVhayA9IE1hdGguZmxvb3IoeSAvIHRoaXMucGFnZVdyYXBZKSArIDE7CiAgICAgICAgICAgICAgICAgICAgYXV0b0JyZWFrcyArPSBwYWdlc1NpbmNlTGFzdEJyZWFrOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgcmV0dXJuIGF1dG9CcmVha3MgKyBtYW51YWxCcmVha3M7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5wZGYuaW50ZXJuYWwuZ2V0Q3VycmVudFBhZ2VJbmZvKCkucGFnZU51bWJlcjsKICAgICAgICAgICAgfQogICAgICAgIH0sCgogICAgICAgIF9nb3RvUGFnZTogZnVuY3Rpb24gX2dvdG9QYWdlKHBhZ2VPbmVCYXNlZCkgewogICAgICAgICAgICAvLyBUaGlzIGlzIGEgc3R1YiB0byBiZSBvdmVycmlkZW4gaWYgbmVlZGVkCiAgICAgICAgfSwKCiAgICAgICAgbGluZVRvOiBmdW5jdGlvbiBsaW5lVG8oeCwgeSkgewogICAgICAgICAgICB4ID0gdGhpcy5fd3JhcFgoeCk7CiAgICAgICAgICAgIHkgPSB0aGlzLl93cmFwWSh5KTsKCiAgICAgICAgICAgIHZhciB4cHQgPSB0aGlzLl9tYXRyaXhfbWFwX3BvaW50KHRoaXMuY3R4Ll90cmFuc2Zvcm0sIFt4LCB5XSk7CiAgICAgICAgICAgIHggPSB4cHRbMF07CiAgICAgICAgICAgIHkgPSB4cHRbMV07CgogICAgICAgICAgICB2YXIgb2JqID0gewogICAgICAgICAgICAgICAgdHlwZTogJ2x0JywKICAgICAgICAgICAgICAgIHg6IHgsCiAgICAgICAgICAgICAgICB5OiB5CiAgICAgICAgICAgIH07CiAgICAgICAgICAgIHRoaXMucGF0aC5wdXNoKG9iaik7CiAgICAgICAgfSwKCiAgICAgICAgYmV6aWVyQ3VydmVUbzogZnVuY3Rpb24gYmV6aWVyQ3VydmVUbyh4MSwgeTEsIHgyLCB5MiwgeCwgeSkgewogICAgICAgICAgICB4MSA9IHRoaXMuX3dyYXBYKHgxKTsKICAgICAgICAgICAgeTEgPSB0aGlzLl93cmFwWSh5MSk7CiAgICAgICAgICAgIHgyID0gdGhpcy5fd3JhcFgoeDIpOwogICAgICAgICAgICB5MiA9IHRoaXMuX3dyYXBZKHkyKTsKICAgICAgICAgICAgeCA9IHRoaXMuX3dyYXBYKHgpOwogICAgICAgICAgICB5ID0gdGhpcy5fd3JhcFkoeSk7CgogICAgICAgICAgICB2YXIgeHB0OwogICAgICAgICAgICB4cHQgPSB0aGlzLl9tYXRyaXhfbWFwX3BvaW50KHRoaXMuY3R4Ll90cmFuc2Zvcm0sIFt4LCB5XSk7CiAgICAgICAgICAgIHggPSB4cHRbMF07CiAgICAgICAgICAgIHkgPSB4cHRbMV07CiAgICAgICAgICAgIHhwdCA9IHRoaXMuX21hdHJpeF9tYXBfcG9pbnQodGhpcy5jdHguX3RyYW5zZm9ybSwgW3gxLCB5MV0pOwogICAgICAgICAgICB4MSA9IHhwdFswXTsKICAgICAgICAgICAgeTEgPSB4cHRbMV07CiAgICAgICAgICAgIHhwdCA9IHRoaXMuX21hdHJpeF9tYXBfcG9pbnQodGhpcy5jdHguX3RyYW5zZm9ybSwgW3gyLCB5Ml0pOwogICAgICAgICAgICB4MiA9IHhwdFswXTsKICAgICAgICAgICAgeTIgPSB4cHRbMV07CgogICAgICAgICAgICB2YXIgb2JqID0gewogICAgICAgICAgICAgICAgdHlwZTogJ2JjdCcsCiAgICAgICAgICAgICAgICB4MTogeDEsCiAgICAgICAgICAgICAgICB5MTogeTEsCiAgICAgICAgICAgICAgICB4MjogeDIsCiAgICAgICAgICAgICAgICB5MjogeTIsCiAgICAgICAgICAgICAgICB4OiB4LAogICAgICAgICAgICAgICAgeTogeQogICAgICAgICAgICB9OwogICAgICAgICAgICB0aGlzLnBhdGgucHVzaChvYmopOwogICAgICAgIH0sCgogICAgICAgIHF1YWRyYXRpY0N1cnZlVG86IGZ1bmN0aW9uIHF1YWRyYXRpY0N1cnZlVG8oeDEsIHkxLCB4LCB5KSB7CiAgICAgICAgICAgIHgxID0gdGhpcy5fd3JhcFgoeDEpOwogICAgICAgICAgICB5MSA9IHRoaXMuX3dyYXBZKHkxKTsKICAgICAgICAgICAgeCA9IHRoaXMuX3dyYXBYKHgpOwogICAgICAgICAgICB5ID0gdGhpcy5fd3JhcFkoeSk7CgogICAgICAgICAgICB2YXIgeHB0OwogICAgICAgICAgICB4cHQgPSB0aGlzLl9tYXRyaXhfbWFwX3BvaW50KHRoaXMuY3R4Ll90cmFuc2Zvcm0sIFt4LCB5XSk7CiAgICAgICAgICAgIHggPSB4cHRbMF07CiAgICAgICAgICAgIHkgPSB4cHRbMV07CiAgICAgICAgICAgIHhwdCA9IHRoaXMuX21hdHJpeF9tYXBfcG9pbnQodGhpcy5jdHguX3RyYW5zZm9ybSwgW3gxLCB5MV0pOwogICAgICAgICAgICB4MSA9IHhwdFswXTsKICAgICAgICAgICAgeTEgPSB4cHRbMV07CgogICAgICAgICAgICB2YXIgb2JqID0gewogICAgICAgICAgICAgICAgdHlwZTogJ3FjdCcsCiAgICAgICAgICAgICAgICB4MTogeDEsCiAgICAgICAgICAgICAgICB5MTogeTEsCiAgICAgICAgICAgICAgICB4OiB4LAogICAgICAgICAgICAgICAgeTogeQogICAgICAgICAgICB9OwogICAgICAgICAgICB0aGlzLnBhdGgucHVzaChvYmopOwogICAgICAgIH0sCgogICAgICAgIGFyYzogZnVuY3Rpb24gYXJjKHgsIHksIHJhZGl1cywgc3RhcnRBbmdsZSwgZW5kQW5nbGUsIGFudGljbG9ja3dpc2UpIHsKICAgICAgICAgICAgeCA9IHRoaXMuX3dyYXBYKHgpOwogICAgICAgICAgICB5ID0gdGhpcy5fd3JhcFkoeSk7CgogICAgICAgICAgICB2YXIgeHB0ID0gdGhpcy5fbWF0cml4X21hcF9wb2ludCh0aGlzLmN0eC5fdHJhbnNmb3JtLCBbeCwgeV0pOwogICAgICAgICAgICB4ID0geHB0WzBdOwogICAgICAgICAgICB5ID0geHB0WzFdOwoKICAgICAgICAgICAgdmFyIG9iaiA9IHsKICAgICAgICAgICAgICAgIHR5cGU6ICdhcmMnLAogICAgICAgICAgICAgICAgeDogeCwKICAgICAgICAgICAgICAgIHk6IHksCiAgICAgICAgICAgICAgICByYWRpdXM6IHJhZGl1cywKICAgICAgICAgICAgICAgIHN0YXJ0QW5nbGU6IHN0YXJ0QW5nbGUsCiAgICAgICAgICAgICAgICBlbmRBbmdsZTogZW5kQW5nbGUsCiAgICAgICAgICAgICAgICBhbnRpY2xvY2t3aXNlOiBhbnRpY2xvY2t3aXNlCiAgICAgICAgICAgIH07CiAgICAgICAgICAgIHRoaXMucGF0aC5wdXNoKG9iaik7CiAgICAgICAgfSwKCiAgICAgICAgZHJhd0ltYWdlOiBmdW5jdGlvbiBkcmF3SW1hZ2UoaW1nLCB4LCB5LCB3LCBoLCB4MiwgeTIsIHcyLCBoMikgewogICAgICAgICAgICBpZiAoeDIgIT09IHVuZGVmaW5lZCkgewogICAgICAgICAgICAgICAgeCA9IHgyOwogICAgICAgICAgICAgICAgeSA9IHkyOwogICAgICAgICAgICAgICAgdyA9IHcyOwogICAgICAgICAgICAgICAgaCA9IGgyOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHggPSB0aGlzLl93cmFwWCh4KTsKICAgICAgICAgICAgeSA9IHRoaXMuX3dyYXBZKHkpOwoKICAgICAgICAgICAgdmFyIHhSZWN0ID0gdGhpcy5fbWF0cml4X21hcF9yZWN0KHRoaXMuY3R4Ll90cmFuc2Zvcm0sIHsgeDogeCwgeTogeSwgdzogdywgaDogaCB9KTsKICAgICAgICAgICAgdmFyIHhSZWN0MiA9IHRoaXMuX21hdHJpeF9tYXBfcmVjdCh0aGlzLmN0eC5fdHJhbnNmb3JtLCB7IHg6IHgyLCB5OiB5MiwgdzogdzIsIGg6IGgyIH0pOwoKICAgICAgICAgICAgLy8gVE9ETyBpbXBsZW1lbnQgc291cmNlIGNsaXBwaW5nIGFuZCBpbWFnZSBzY2FsaW5nCiAgICAgICAgICAgIHZhciBmb3JtYXQ7CiAgICAgICAgICAgIHZhciByeCA9IC9kYXRhOmltYWdlXC8oXHcrKS4qL2k7CiAgICAgICAgICAgIHZhciBtID0gcnguZXhlYyhpbWcpOwogICAgICAgICAgICBpZiAobSAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICBmb3JtYXQgPSBtWzFdOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgLy8gZm9ybWF0ID0gImpwZWciOwogICAgICAgICAgICAgICAgZm9ybWF0ID0gInBuZyI7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIHRoaXMucGRmLmFkZEltYWdlKGltZywgZm9ybWF0LCB4UmVjdC54LCB4UmVjdC55LCB4UmVjdC53LCB4UmVjdC5oKTsKICAgICAgICB9LAoKICAgICAgICAvKioKICAgICAgICAgKiBNdWx0aXBseSB0aGUgZmlyc3QgbWF0cml4IGJ5IHRoZSBzZWNvbmQKICAgICAgICAgKiBAcGFyYW0gbTEKICAgICAgICAgKiBAcGFyYW0gbTIKICAgICAgICAgKiBAcmV0dXJucyB7KltdfQogICAgICAgICAqIEBwcml2YXRlCiAgICAgICAgICovCiAgICAgICAgX21hdHJpeF9tdWx0aXBseTogZnVuY3Rpb24gX21hdHJpeF9tdWx0aXBseShtMiwgbTEpIHsKICAgICAgICAgICAgdmFyIHN4ID0gbTFbMF07CiAgICAgICAgICAgIHZhciBzaHkgPSBtMVsxXTsKICAgICAgICAgICAgdmFyIHNoeCA9IG0xWzJdOwogICAgICAgICAgICB2YXIgc3kgPSBtMVszXTsKICAgICAgICAgICAgdmFyIHR4ID0gbTFbNF07CiAgICAgICAgICAgIHZhciB0eSA9IG0xWzVdOwoKICAgICAgICAgICAgdmFyIHQwID0gc3ggKiBtMlswXSArIHNoeSAqIG0yWzJdOwogICAgICAgICAgICB2YXIgdDIgPSBzaHggKiBtMlswXSArIHN5ICogbTJbMl07CiAgICAgICAgICAgIHZhciB0NCA9IHR4ICogbTJbMF0gKyB0eSAqIG0yWzJdICsgbTJbNF07CiAgICAgICAgICAgIHNoeSA9IHN4ICogbTJbMV0gKyBzaHkgKiBtMlszXTsKICAgICAgICAgICAgc3kgPSBzaHggKiBtMlsxXSArIHN5ICogbTJbM107CiAgICAgICAgICAgIHR5ID0gdHggKiBtMlsxXSArIHR5ICogbTJbM10gKyBtMls1XTsKICAgICAgICAgICAgc3ggPSB0MDsKICAgICAgICAgICAgc2h4ID0gdDI7CiAgICAgICAgICAgIHR4ID0gdDQ7CgogICAgICAgICAgICByZXR1cm4gW3N4LCBzaHksIHNoeCwgc3ksIHR4LCB0eV07CiAgICAgICAgfSwKCiAgICAgICAgX21hdHJpeF9yb3RhdGlvbjogZnVuY3Rpb24gX21hdHJpeF9yb3RhdGlvbihtKSB7CiAgICAgICAgICAgIHJldHVybiBNYXRoLmF0YW4yKG1bMl0sIG1bMF0pOwogICAgICAgIH0sCgogICAgICAgIF9tYXRyaXhfZGVjb21wb3NlOiBmdW5jdGlvbiBfbWF0cml4X2RlY29tcG9zZShtYXRyaXgpIHsKCiAgICAgICAgICAgIHZhciBhID0gbWF0cml4WzBdOwogICAgICAgICAgICB2YXIgYiA9IG1hdHJpeFsxXTsKICAgICAgICAgICAgdmFyIGMgPSBtYXRyaXhbMl07CiAgICAgICAgICAgIHZhciBkID0gbWF0cml4WzNdOwoKICAgICAgICAgICAgdmFyIHNjYWxlWCA9IE1hdGguc3FydChhICogYSArIGIgKiBiKTsKICAgICAgICAgICAgYSAvPSBzY2FsZVg7CiAgICAgICAgICAgIGIgLz0gc2NhbGVYOwoKICAgICAgICAgICAgdmFyIHNoZWFyID0gYSAqIGMgKyBiICogZDsKICAgICAgICAgICAgYyAtPSBhICogc2hlYXI7CiAgICAgICAgICAgIGQgLT0gYiAqIHNoZWFyOwoKICAgICAgICAgICAgdmFyIHNjYWxlWSA9IE1hdGguc3FydChjICogYyArIGQgKiBkKTsKICAgICAgICAgICAgYyAvPSBzY2FsZVk7CiAgICAgICAgICAgIGQgLz0gc2NhbGVZOwogICAgICAgICAgICBzaGVhciAvPSBzY2FsZVk7CgogICAgICAgICAgICBpZiAoYSAqIGQgPCBiICogYykgewogICAgICAgICAgICAgICAgYSA9IC1hOwogICAgICAgICAgICAgICAgYiA9IC1iOwogICAgICAgICAgICAgICAgc2hlYXIgPSAtc2hlYXI7CiAgICAgICAgICAgICAgICBzY2FsZVggPSAtc2NhbGVYOwogICAgICAgICAgICB9CgogICAgICAgICAgICByZXR1cm4gewogICAgICAgICAgICAgICAgc2NhbGU6IFtzY2FsZVgsIDAsIDAsIHNjYWxlWSwgMCwgMF0sCiAgICAgICAgICAgICAgICB0cmFuc2xhdGU6IFsxLCAwLCAwLCAxLCBtYXRyaXhbNF0sIG1hdHJpeFs1XV0sCiAgICAgICAgICAgICAgICByb3RhdGU6IFthLCBiLCAtYiwgYSwgMCwgMF0sCiAgICAgICAgICAgICAgICBza2V3OiBbMSwgMCwgc2hlYXIsIDEsIDAsIDBdCiAgICAgICAgICAgIH07CiAgICAgICAgfSwKCiAgICAgICAgX21hdHJpeF9tYXBfcG9pbnQ6IGZ1bmN0aW9uIF9tYXRyaXhfbWFwX3BvaW50KG0xLCBwdCkgewogICAgICAgICAgICB2YXIgc3ggPSBtMVswXTsKICAgICAgICAgICAgdmFyIHNoeSA9IG0xWzFdOwogICAgICAgICAgICB2YXIgc2h4ID0gbTFbMl07CiAgICAgICAgICAgIHZhciBzeSA9IG0xWzNdOwogICAgICAgICAgICB2YXIgdHggPSBtMVs0XTsKICAgICAgICAgICAgdmFyIHR5ID0gbTFbNV07CgogICAgICAgICAgICB2YXIgcHggPSBwdFswXTsKICAgICAgICAgICAgdmFyIHB5ID0gcHRbMV07CgogICAgICAgICAgICB2YXIgeCA9IHB4ICogc3ggKyBweSAqIHNoeCArIHR4OwogICAgICAgICAgICB2YXIgeSA9IHB4ICogc2h5ICsgcHkgKiBzeSArIHR5OwogICAgICAgICAgICByZXR1cm4gW3gsIHldOwogICAgICAgIH0sCgogICAgICAgIF9tYXRyaXhfbWFwX3BvaW50X29iajogZnVuY3Rpb24gX21hdHJpeF9tYXBfcG9pbnRfb2JqKG0xLCBwdCkgewogICAgICAgICAgICB2YXIgeHB0ID0gdGhpcy5fbWF0cml4X21hcF9wb2ludChtMSwgW3B0LngsIHB0LnldKTsKICAgICAgICAgICAgcmV0dXJuIHsgeDogeHB0WzBdLCB5OiB4cHRbMV0gfTsKICAgICAgICB9LAoKICAgICAgICBfbWF0cml4X21hcF9yZWN0OiBmdW5jdGlvbiBfbWF0cml4X21hcF9yZWN0KG0xLCByZWN0KSB7CiAgICAgICAgICAgIHZhciBwMSA9IHRoaXMuX21hdHJpeF9tYXBfcG9pbnQobTEsIFtyZWN0LngsIHJlY3QueV0pOwogICAgICAgICAgICB2YXIgcDIgPSB0aGlzLl9tYXRyaXhfbWFwX3BvaW50KG0xLCBbcmVjdC54ICsgcmVjdC53LCByZWN0LnkgKyByZWN0LmhdKTsKICAgICAgICAgICAgcmV0dXJuIHsgeDogcDFbMF0sIHk6IHAxWzFdLCB3OiBwMlswXSAtIHAxWzBdLCBoOiBwMlsxXSAtIHAxWzFdIH07CiAgICAgICAgfSwKCiAgICAgICAgX21hdHJpeF9pc19pZGVudGl0eTogZnVuY3Rpb24gX21hdHJpeF9pc19pZGVudGl0eShtMSkgewogICAgICAgICAgICBpZiAobTFbMF0gIT0gMSkgewogICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGlmIChtMVsxXSAhPSAwKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKG0xWzJdICE9IDApIHsKICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgfQogICAgICAgICAgICBpZiAobTFbM10gIT0gMSkgewogICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGlmIChtMVs0XSAhPSAwKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKG0xWzVdICE9IDApIHsKICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICB9LAoKICAgICAgICByb3RhdGU6IGZ1bmN0aW9uIHJvdGF0ZShhbmdsZSkgewogICAgICAgICAgICB2YXIgbWF0cml4ID0gW01hdGguY29zKGFuZ2xlKSwgTWF0aC5zaW4oYW5nbGUpLCAtTWF0aC5zaW4oYW5nbGUpLCBNYXRoLmNvcyhhbmdsZSksIDAuMCwgMC4wXTsKICAgICAgICAgICAgdGhpcy5jdHguX3RyYW5zZm9ybSA9IHRoaXMuX21hdHJpeF9tdWx0aXBseSh0aGlzLmN0eC5fdHJhbnNmb3JtLCBtYXRyaXgpOwogICAgICAgIH0sCgogICAgICAgIHNjYWxlOiBmdW5jdGlvbiBzY2FsZShzeCwgc3kpIHsKICAgICAgICAgICAgdmFyIG1hdH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dGhpcy5jdHguX2NsaXBfcGF0aCA9IFtdOwogICAgICAgICAgICAgICAgdGhpcy5fc3Ryb2tlKHRydWUpOwoKICAgICAgICAgICAgICAgIHRoaXMuY3R4Ll9jbGlwX3BhdGggPSB0aGlzLnBhdGg7CiAgICAgICAgICAgICAgICB0aGlzLnBhdGggPSBvcmlnUGF0aDsKICAgICAgICAgICAgICAgIHRoaXMuX3N0cm9rZShmYWxzZSk7CgogICAgICAgICAgICAgICAgbGluZXMucHVzaCgiUSIpOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgdGhpcy5fc3Ryb2tlKGZhbHNlKTsKICAgICAgICAgICAgfQogICAgICAgIH0sCgogICAgICAgIF9zdHJva2U6IGZ1bmN0aW9uIF9zdHJva2UoaXNDbGlwKSB7CiAgICAgICAgICAgIGlmICghaXNDbGlwICYmIHRoaXMuX2lzU3Ryb2tlVHJhbnNwYXJlbnQoKSkgewogICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICB9CgogICAgICAgICAgICAvL1RPRE8gb3BhY2l0eQoKICAgICAgICAgICAgdmFyIG1vdmVzID0gW107CiAgICAgICAgICAgIHZhciBjbG9zZWQgPSBmYWxzZTsKCiAgICAgICAgICAgIHZhciB4UGF0aCA9IHRoaXMucGF0aDsKCiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgeFBhdGgubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgICAgIHZhciBwdCA9IHhQYXRoW2ldOwogICAgICAgICAgICAgICAgc3dpdGNoIChwdC50eXBlKSB7CiAgICAgICAgICAgICAgICAgICAgY2FzZSAnbXQnOgogICAgICAgICAgICAgICAgICAgICAgICBtb3Zlcy5wdXNoKHsgc3RhcnQ6IHB0LCBkZWx0YXM6IFtdLCBhYnM6IFtdIH0pOwogICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICBjYXNlICdsdCc6CiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkZWx0YSA9IFtwdC54IC0geFBhdGhbaSAtIDFdLngsIHB0LnkgLSB4UGF0aFtpIC0gMV0ueV07CiAgICAgICAgICAgICAgICAgICAgICAgIG1vdmVzW21vdmVzLmxlbmd0aCAtIDFdLmRlbHRhcy5wdXNoKGRlbHRhKTsKICAgICAgICAgICAgICAgICAgICAgICAgbW92ZXNbbW92ZXMubGVuZ3RoIC0gMV0uYWJzLnB1c2gocHQpOwogICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICBjYXNlICdiY3QnOgogICAgICAgICAgICAgICAgICAgICAgICB2YXIgZGVsdGEgPSBbcHQueDEgLSB4UGF0aFtpIC0gMV0ueCwgcHQueTEgLSB4UGF0aFtpIC0gMV0ueSwgcHQueDIgLSB4UGF0aFtpIC0gMV0ueCwgcHQueTIgLSB4UGF0aFtpIC0gMV0ueSwgcHQueCAtIHhQYXRoW2kgLSAxXS54LCBwdC55IC0geFBhdGhbaSAtIDFdLnldOwogICAgICAgICAgICAgICAgICAgICAgICBtb3Zlc1ttb3Zlcy5sZW5ndGggLSAxXS5kZWx0YXMucHVzaChkZWx0YSk7CiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgIGNhc2UgJ3FjdCc6CiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNvbnZlcnQgdG8gYmV6aWVyCiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB4MSA9IHhQYXRoW2kgLSAxXS54ICsgMi4wIC8gMy4wICogKHB0LngxIC0geFBhdGhbaSAtIDFdLngpOwogICAgICAgICAgICAgICAgICAgICAgICB2YXIgeTEgPSB4UGF0aFtpIC0gMV0ueSArIDIuMCAvIDMuMCAqIChwdC55MSAtIHhQYXRoW2kgLSAxXS55KTsKICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHgyID0gcHQueCArIDIuMCAvIDMuMCAqIChwdC54MSAtIHB0LngpOwogICAgICAgICAgICAgICAgICAgICAgICB2YXIgeTIgPSBwdC55ICsgMi4wIC8gMy4wICogKHB0LnkxIC0gcHQueSk7CiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB4MyA9IHB0Lng7CiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB5MyA9IHB0Lnk7CiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkZWx0YSA9IFt4MSAtIHhQYXRoW2kgLSAxXS54LCB5MSAtIHhQYXRoW2kgLSAxXS55LCB4MiAtIHhQYXRoW2kgLSAxXS54LCB5MiAtIHhQYXRoW2kgLSAxXS55LCB4MyAtIHhQYXRoW2kgLSAxXS54LCB5MyAtIHhQYXRoW2kgLSAxXS55XTsKICAgICAgICAgICAgICAgICAgICAgICAgbW92ZXNbbW92ZXMubGVuZ3RoIC0gMV0uZGVsdGFzLnB1c2goZGVsdGEpOwogICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICBjYXNlICdhcmMnOgogICAgICAgICAgICAgICAgICAgICAgICBtb3Zlc1ttb3Zlcy5sZW5ndGggLSAxXS5hcmMgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgICAgICBtb3Zlc1ttb3Zlcy5sZW5ndGggLSAxXS5hYnMucHVzaChwdCk7CiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgIGNhc2UgJ2Nsb3NlJzoKICAgICAgICAgICAgICAgICAgICAgICAgY2xvc2VkID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbW92ZXMubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgICAgIHZhciBzdHlsZTsKICAgICAgICAgICAgICAgIGlmIChpID09IG1vdmVzLmxlbmd0aCAtIDEpIHsKICAgICAgICAgICAgICAgICAgICBzdHlsZSA9ICdzJzsKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgc3R5bGUgPSBudWxsOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgaWYgKG1vdmVzW2ldLmFyYykgewogICAgICAgICAgICAgICAgICAgIHZhciBhcmNzID0gbW92ZXNbaV0uYWJzOwogICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGlpID0gMDsgaWkgPCBhcmNzLmxlbmd0aDsgaWkrKykgewogICAgICAgICAgICAgICAgICAgICAgICB2YXIgYXJjID0gYXJjc1tpaV07CiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzdGFydCA9IGFyYy5zdGFydEFuZ2xlICogMzYwIC8gKDIgKiBNYXRoLlBJKTsKICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGVuZCA9IGFyYy5lbmRBbmdsZSAqIDM2MCAvICgyICogTWF0aC5QSSk7CiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB4ID0gYXJjLng7CiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB5ID0gYXJjLnk7CiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuaW50ZXJuYWwuYXJjMih0aGlzLCB4LCB5LCBhcmMucmFkaXVzLCBzdGFydCwgZW5kLCBhcmMuYW50aWNsb2Nrd2lzZSwgc3R5bGUsIGlzQ2xpcCk7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICB2YXIgeCA9IG1vdmVzW2ldLnN0YXJ0Lng7CiAgICAgICAgICAgICAgICAgICAgdmFyIHkgPSBtb3Zlc1tpXS5zdGFydC55OwogICAgICAgICAgICAgICAgICAgIGlmICghaXNDbGlwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGRmLmxpbmVzKG1vdmVzW2ldLmRlbHRhcywgeCwgeSwgbnVsbCwgc3R5bGUpOwogICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGRmLmxpbmVzKG1vdmVzW2ldLmRlbHRhcywgeCwgeSwgbnVsbCwgbnVsbCk7CiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGRmLmNsaXBfZml4ZWQoKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9LAoKICAgICAgICBfaXNGaWxsVHJhbnNwYXJlbnQ6IGZ1bmN0aW9uIF9pc0ZpbGxUcmFuc3BhcmVudCgpIHsKICAgICAgICAgICAgcmV0dXJuIHRoaXMuY3R4Ll9pc0ZpbGxUcmFuc3BhcmVudCB8fCB0aGlzLmdsb2JhbEFscGhhID09IDA7CiAgICAgICAgfSwKCiAgICAgICAgX2lzU3Ryb2tlVHJhbnNwYXJlbnQ6IGZ1bmN0aW9uIF9pc1N0cm9rZVRyYW5zcGFyZW50KCkgewogICAgICAgICAgICByZXR1cm4gdGhpcy5jdHguX2lzU3Ryb2tlVHJhbnNwYXJlbnQgfHwgdGhpcy5nbG9iYWxBbHBoYSA9PSAwOwogICAgICAgIH0sCgogICAgICAgIGZpbGw6IGZ1bmN0aW9uIGZpbGwoZmlsbFJ1bGUpIHsKICAgICAgICAgICAgLy9ldmVub2RkIG9yIG5vbnplcm8gKGRlZmF1bHQpCiAgICAgICAgICAgIGlmICh0aGlzLmN0eC5fY2xpcF9wYXRoLmxlbmd0aCA+IDApIHsKCiAgICAgICAgICAgICAgICB2YXIgbGluZXM7CiAgICAgICAgICAgICAgICBpZiAod2luZG93Lm91dEludGVyY2VwdCkgewogICAgICAgICAgICAgICAgICAgIGxpbmVzID0gd2luZG93Lm91dEludGVyY2VwdC50eXBlID09PSAnZ3JvdXAnID8gd2luZG93Lm91dEludGVyY2VwdC5zdHJlYW0gOiB3aW5kb3cub3V0SW50ZXJjZXB0OwogICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICBsaW5lcyA9IHRoaXMucGRmLmludGVybmFsLnBhZ2VzWzFdOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgbGluZXMucHVzaCgicSIpOwoKICAgICAgICAgICAgICAgIHZhciBvcmlnUGF0aCA9IHRoaXMucGF0aDsKICAgICAgICAgICAgICAgIHRoaXMucGF0aCA9IHRoaXMuY3R4Ll9jbGlwX3BhdGg7CiAgICAgICAgICAgICAgICB0aGlzLmN0eC5fY2xpcF9wYXRoID0gW107CiAgICAgICAgICAgICAgICB0aGlzLl9maWxsKGZpbGxSdWxlLCB0cnVlKTsKCiAgICAgICAgICAgICAgICB0aGlzLmN0eC5fY2xpcF9wYXRoID0gdGhpcy5wYXRoOwogICAgICAgICAgICAgICAgdGhpcy5wYXRoID0gb3JpZ1BhdGg7CiAgICAgICAgICAgICAgICB0aGlzLl9maWxsKGZpbGxSdWxlLCBmYWxzZSk7CgogICAgICAgICAgICAgICAgbGluZXMucHVzaCgnUScpOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgdGhpcy5fZmlsbChmaWxsUnVsZSwgZmFsc2UpOwogICAgICAgICAgICB9CiAgICAgICAgfSwKCiAgICAgICAgX2ZpbGw6IGZ1bmN0aW9uIF9maWxsKGZpbGxSdWxlLCBpc0NsaXApIHsKICAgICAgICAgICAgaWYgKHRoaXMuX2lzRmlsbFRyYW5zcGFyZW50KCkpIHsKICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgfQogICAgICAgICAgICB2YXIgdjJTdXBwb3J0ID0gdHlwZW9mIHRoaXMucGRmLmludGVybmFsLm5ld09iamVjdDIgPT09ICdmdW5jdGlvbic7CgogICAgICAgICAgICB2YXIgbGluZXM7CiAgICAgICAgICAgIGlmICh3aW5kb3cub3V0SW50ZXJjZXB0KSB7CiAgICAgICAgICAgICAgICBsaW5lcyA9IHdpbmRvdy5vdXRJbnRlcmNlcHQudHlwZSA9PT0gJ2dyb3VwJyA/IHdpbmRvdy5vdXRJbnRlcmNlcHQuc3RyZWFtIDogd2luZG93Lm91dEludGVyY2VwdDsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIGxpbmVzID0gdGhpcy5wZGYuaW50ZXJuYWwucGFnZXNbMV07CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIC8vIGlmICh0aGlzLmN0eC5fY2xpcF9wYXRoLmxlbmd0aCA+IDApIHsKICAgICAgICAgICAgLy8gICAgIGxpbmVzLnB1c2goJ3EnKTsKICAgICAgICAgICAgLy8gICAgIHZhciBvbGRQYXRoID0gdGhpcy5wYXRoOwogICAgICAgICAgICAvLyAgICAgdGhpcy5wYXRoID0gdGhpcy5jdHguX2NsaXBfcGF0aDsKICAgICAgICAgICAgLy8gICAgIHRoaXMuY3R4Ll9jbGlwX3BhdGggPSBbXTsKICAgICAgICAgICAgLy8gICAgIHRoaXMuX2ZpbGwoZmlsbFJ1bGUsIHRydWUpOwogICAgICAgICAgICAvLyAgICAgdGhpcy5jdHguX2NsaXBfcGF0aCA9IHRoaXMucGF0aDsKICAgICAgICAgICAgLy8gICAgIHRoaXMucGF0aCA9IG9sZFBhdGg7CiAgICAgICAgICAgIC8vIH0KCiAgICAgICAgICAgIHZhciBtb3ZlcyA9IFtdOwogICAgICAgICAgICB2YXIgb3V0SW50ZXJjZXB0T2xkID0gd2luZG93Lm91dEludGVyY2VwdDsKCiAgICAgICAgICAgIGlmICh2MlN1cHBvcnQpIHsKICAgICAgICAgICAgICAgIC8vIEJsZW5kIGFuZCBNYXNrCiAgICAgICAgICAgICAgICBzd2l0Y2ggKHRoaXMuY3R4Lmdsb2JhbENvbXBvc2l0ZU9wZXJhdGlvbikgewogICAgICAgICAgICAgICAgICAgIGNhc2UgJ25vcm1hbCc6CiAgICAgICAgICAgICAgICAgICAgY2FzZSAnc291cmNlLW92ZXInOgogICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICBjYXNlICdkZXN0aW5hdGlvbi1pbic6CiAgICAgICAgICAgICAgICAgICAgY2FzZSAnZGVzdGluYXRpb24tb3V0JzoKICAgICAgICAgICAgICAgICAgICAgICAgLy9UT0RPIHRoaXMgbmVlZCB0byBiZSBhZGRlZCB0byB0aGUgY3VycmVudCBncm91cCBvciBwYWdlCiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGRlZmluZSBhIG1hc2sgc3RyZWFtCiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBvYmogPSB0aGlzLnBkZi5pbnRlcm5hbC5uZXdTdHJlYW1PYmplY3QoKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGRlZmluZSBhIG1hc2sgc3RhdGUKICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG9iajIgPSB0aGlzLnBkZi5pbnRlcm5hbC5uZXdPYmplY3QyKCk7CiAgICAgICAgICAgICAgICAgICAgICAgIG9iajIucHVzaCgnPDwvVHlwZSAvRXh0R1N0YXRlJyk7CiAgICAgICAgICAgICAgICAgICAgICAgIG9iajIucHVzaCgnL1NNYXNrIDw8L1MgL0FscGhhIC9HICcgKyBvYmoub2JqSWQgKyAnIDAgUj4+Jyk7IC8vIC9TIC9MdW1pbm9zaXR5IHdpbGwgbmVlZCB0byBkZWZpbmUgY29sb3Igc3BhY2UKICAgICAgICAgICAgICAgICAgICAgICAgb2JqMi5wdXNoKCc+PicpOwoKICAgICAgICAgICAgICAgICAgICAgICAgLy8gYWRkIG1hc2sgdG8gcGFnZSByZXNvdXJjZXMKICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGdzTmFtZSA9ICdNQVNLJyArIG9iajIub2JqSWQ7CiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGRmLmludGVybmFsLmFkZEdyYXBoaWNzU3RhdGUoZ3NOYW1lLCBvYmoyLm9iaklkKTsKCiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpbnN0cnVjdGlvbiA9ICcvJyArIGdzTmFtZSArICcgZ3MnOwogICAgICAgICAgICAgICAgICAgICAgICAvLyBhZGQgbWFzayB0byBwYWdlLCBncm91cCwgb3Igc3RyZWFtCiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVzLnNwbGljZSgwLCAwLCAncScpOwogICAgICAgICAgICAgICAgICAgICAgICBsaW5lcy5zcGxpY2UoMSwgMCwgaW5zdHJ1Y3Rpb24pOwogICAgICAgICAgICAgICAgICAgICAgICBsaW5lcy5wdXNoKCdRJyk7CgogICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3cub3V0SW50ZXJjZXB0ID0gb2JqOwogICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgICAgICAgICAgICB2YXIgZGljdGlvbmFyeUVudHJ5ID0gJy8nICsgdGhpcy5wZGYuaW50ZXJuYWwuYmxlbmRNb2RlTWFwW3RoaXMuY3R4Lmdsb2JhbENvbXBvc2l0ZU9wZXJhdGlvbi50b1VwcGVyQ2FzZSgpXTsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRpY3Rpb25hcnlFbnRyeSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wZGYuaW50ZXJuYWwub3V0KGRpY3Rpb25hcnlFbnRyeSArICcgZ3MnKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQoKICAgICAgICAgICAgdmFyIGFscGhhID0gdGhpcy5jdHguZ2xvYmFsQWxwaGE7CiAgICAgICAgICAgIGlmICh0aGlzLmN0eC5fZmlsbE9wYWNpdHkgPCAxKSB7CiAgICAgICAgICAgICAgICAvLyBUT0RPIGNvbWJpbmUgdGhpcyB3aXRoIGdsb2JhbCBvcGFjaXR5CiAgICAgICAgICAgICAgICBhbHBoYSA9IHRoaXMuY3R4Ll9maWxsT3BhY2l0eTsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgLy9UT0RPIGNoZWNrIGZvciBhbiBvcGFjaXR5IGdyYXBoaWNzIHN0YXRlIHRoYXQgd2FzIGFscmVhZHkgY3JlYXRlZAogICAgICAgICAgICAvL1RPRE8gZG8gbm90IHNldCBvcGFjaXR5IGlmIGN1cnJlbnQgdmFsdWUgaXMgYWxyZWFkeSBhY3RpdmUKICAgICAgICAgICAgaWYgKHYyU3VwcG9ydCkgewogICAgICAgICAgICAgICAgdmFyIG9iak9wYWMgPSB0aGlzLnBkZi5pbnRlcm5hbC5uZXdPYmplY3QyKCk7CiAgICAgICAgICAgICAgICBvYmpPcGFjLnB1c2goJzw8L1R5cGUgL0V4dEdTdGF0ZScpOwogICAgICAgICAgICAgICAgLy9vYmpPcGFjLnB1c2godGhpcy5jdHguZ2xvYmFsQWxwaGEgKyAiIENBIik7IC8vIFN0cm9rZQogICAgICAgICAgICAgICAgLy9vYmpPcGFjLnB1c2godGhpcy5jdHguZ2xvYmFsQWxwaGEgKyAiIGNhIik7IC8vIE5vdCBTdHJva2UKICAgICAgICAgICAgICAgIG9iak9wYWMucHVzaCgnL0NBICcgKyBhbHBoYSk7IC8vIFN0cm9rZQogICAgICAgICAgICAgICAgb2JqT3BhYy5wdXNoKCcvY2EgJyArIGFscGhhKTsgLy8gTm90IFN0cm9rZQogICAgICAgICAgICAgICAgb2JqT3BhYy5wdXNoKCc+PicpOwogICAgICAgICAgICAgICAgdmFyIGdzTmFtZSA9ICdHU19PXycgKyBvYmpPcGFjLm9iaklkOwogICAgICAgICAgICAgICAgdGhpcy5wZGYuaW50ZXJuYWwuYWRkR3JhcGhpY3NTdGF0ZShnc05hbWUsIG9iak9wYWMub2JqSWQpOwogICAgICAgICAgICAgICAgdGhpcy5wZGYuaW50ZXJuYWwub3V0KCcvJyArIGdzTmFtZSArICcgZ3MnKTsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgdmFyIHhQYXRoID0gdGhpcy5wYXRoOwoKICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB4UGF0aC5sZW5ndGg7IGkrKykgewogICAgICAgICAgICAgICAgdmFyIHB0ID0geFBhdGhbaV07CiAgICAgICAgICAgICAgICBzd2l0Y2ggKHB0LnR5cGUpIHsKICAgICAgICAgICAgICAgICAgICBjYXNlICdtdCc6CiAgICAgICAgICAgICAgICAgICAgICAgIG1vdmVzLnB1c2goeyBzdGFydDogcHQsIGRlbHRhczogW10sIGFiczogW10gfSk7CiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgIGNhc2UgJ2x0JzoKICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRlbHRhID0gW3B0LnggLSB4UGF0aFtpIC0gMV0ueCwgcHQueSAtIHhQYXRoW2kgLSAxXS55XTsKICAgICAgICAgICAgICAgICAgICAgICAgbW92ZXNbbW92ZXMubGVuZ3RoIC0gMV0uZGVsdGFzLnB1c2goZGVsdGEpOwogICAgICAgICAgICAgICAgICAgICAgICBtb3Zlc1ttb3Zlcy5sZW5ndGggLSAxXS5hYnMucHVzaChwdCk7CiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgIGNhc2UgJ2JjdCc6CiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkZWx0YSA9IFtwdC54MSAtIHhQYXRoW2kgLSAxXS54LCBwdC55MSAtIHhQYXRoW2kgLSAxXS55LCBwdC54MiAtIHhQYXRoW2kgLSAxXS54LCBwdC55MiAtIHhQYXRoW2kgLSAxXS55LCBwdC54IC0geFBhdGhbaSAtIDFdLngsIHB0LnkgLSB4UGF0aFtpIC0gMV0ueV07CiAgICAgICAgICAgICAgICAgICAgICAgIG1vdmVzW21vdmVzLmxlbmd0aCAtIDFdLmRlbHRhcy5wdXNoKGRlbHRhKTsKICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgY2FzZSAncWN0JzoKICAgICAgICAgICAgICAgICAgICAgICAgLy8gY29udmVydCB0byBiZXppZXIKICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHgxID0geFBhdGhbaSAtIDFdLnggKyAyLjAgLyAzLjAgKiAocHQueDEgLSB4UGF0aFtpIC0gMV0ueCk7CiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB5MSA9IHhQYXRoW2kgLSAxXS55ICsgMi4wIC8gMy4wICogKHB0LnkxIC0geFBhdGhbaSAtIDFdLnkpOwogICAgICAgICAgICAgICAgICAgICAgICB2YXIgeDIgPSBwdC54ICsgMi4wIC8gMy4wICogKHB0LngxIC0gcHQueCk7CiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB5MiA9IHB0LnkgKyAyLjAgLyAzLjAgKiAocHQueTEgLSBwdC55KTsKICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHgzID0gcHQueDsKICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHkzID0gcHQueTsKICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRlbHRhID0gW3gxIC0geFBhdGhbaSAtIDFdLngsIHkxIC0geFBhdGhbaSAtIDFdLnksIHgyIC0geFBhdGhbaSAtIDFdLngsIHkyIC0geFBhdGhbaSAtIDFdLnksIHgzIC0geFBhdGhbaSAtIDFdLngsIHkzIC0geFBhdGhbaSAtIDFdLnldOwogICAgICAgICAgICAgICAgICAgICAgICBtb3Zlc1ttb3Zlcy5sZW5ndGggLSAxXS5kZWx0YXMucHVzaChkZWx0YSk7CiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgIGNhc2UgJ2FyYyc6CiAgICAgICAgICAgICAgICAgICAgICAgIC8vVE9ETyB0aGlzIHdhcyBoYWNrIHRvIGF2b2lkIG91dCBvZiBib3VuZHMgaXNzdWUKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1vdmVzLmxlbmd0aCA9PSAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb3Zlcy5wdXNoKHsgc3RhcnQ6IHsgeDogMCwgeTogMCB9LCBkZWx0YXM6IFtdLCBhYnM6IFtdIH0pOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIG1vdmVzW21vdmVzLmxlbmd0aCAtIDFdLmFyYyA9IHRydWU7CiAgICAgICAgICAgICAgICAgICAgICAgIG1vdmVzW21vdmVzLmxlbmd0aCAtIDFdLmFicy5wdXNoKHB0KTsKICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgY2FzZSAnY2xvc2UnOgogICAgICAgICAgICAgICAgICAgICAgICAvL21vdmVzW21vdmVzLmxlbmd0aCAtIDFdLmRlbHRhcy5wdXNoKCdjbG9zZScpOwogICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQoKICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBtb3Zlcy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICAgICAgdmFyIHN0eWxlOwogICAgICAgICAgICAgICAgaWYgKGkgPT0gbW92ZXMubGVuZ3RoIC0gMSkgewogICAgICAgICAgICAgICAgICAgIHN0eWxlID0gJ2YnOwogICAgICAgICAgICAgICAgICAgIGlmIChmaWxsUnVsZSA9PT0gJ2V2ZW5vZGQnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHN0eWxlICs9ICcqJzsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgIHN0eWxlID0gbnVsbDsKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICBpZiAobW92ZXNbaV0uYXJjKSB7CiAgICAgICAgICAgICAgICAgICAgdmFyIGFyY3MgPSBtb3Zlc1tpXS5hYnM7CiAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaWkgPSAwOyBpaSA8IGFyY3MubGVuZ3RoOyBpaSsrKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhcmMgPSBhcmNzW2lpXTsKICAgICAgICAgICAgICAgICAgICAgICAgLy9UT0RPIGxpbmVzIGRlbHRhcyB3ZXJlIGdldHRpbmcgaW4gaGVyZQogICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGFyYy5zdGFydEFuZ2xlICE9PSAndW5kZWZpbmVkJykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHN0YXJ0ID0gYXJjLnN0YXJ0QW5nbGUgKiAzNjAgLyAoMiAqIE1hdGguUEkpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGVuZCA9IGFyYy5lbmRBbmdsZSAqIDM2MCAvICgyICogTWF0aC5QSSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBBZGQgdGhlIGN1cnJlbnQgcG9zaXRpb24gKGxhc3QgbW92ZSB0bykKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vdmFyIHggPSBtb3Zlc1tpXS5zdGFydC54ICsgYXJjLng7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3ZhciB5ID0gbW92ZXNbaV0uc3RhcnQueSArIGFyYy55OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHggPSBhcmMueDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB5ID0gYXJjLnk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaWkgPT0gMCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuaW50ZXJuYWwubW92ZTIodGhpcywgeCwgeSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmludGVybmFsLmFyYzIodGhpcywgeCwgeSwgYXJjLnJhZGl1cywgc3RhcnQsIGVuZCwgYXJjLmFudGljbG9ja3dpc2UsIG51bGwsIGlzQ2xpcCk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmludGVybmFsLmxpbmUyKGMyZCwgYXJjLngsIGFyYy55KTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgLy8gZXh0cmEgbW92ZSBidWcgY2F1c2luZyBjbG9zZSB0byByZXNvbHZlIHRvIHdyb25nIHBvaW50CiAgICAgICAgICAgICAgICAgICAgdmFyIHggPSBtb3Zlc1tpXS5zdGFydC54OwogICAgICAgICAgICAgICAgICAgIHZhciB5ID0gbW92ZXNbaV0uc3RhcnQueTsKICAgICAgICAgICAgICAgICAgICB0aGlzLmludGVybmFsLmxpbmUyKGMyZCwgeCwgeSk7CgogICAgICAgICAgICAgICAgICAgIHRoaXMucGRmLmludGVybmFsLm91dCgnaCcpOwogICAgICAgICAgICAgICAgICAgIHRoaXMucGRmLmludGVybmFsLm91dCgnZicpOwogICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICB2YXIgeCA9IG1vdmVzW2ldLnN0YXJ0Lng7CiAgICAgICAgICAgICAgICAgICAgdmFyIHkgPSBtb3Zlc1tpXS5zdGFydC55OwogICAgICAgICAgICAgICAgICAgIGlmICghaXNDbGlwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGRmLmxpbmVzKG1vdmVzW2ldLmRlbHRhcywgeCwgeSwgbnVsbCwgc3R5bGUpOwogICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGRmLmxpbmVzKG1vdmVzW2ldLmRlbHRhcywgeCwgeSwgbnVsbCwgbnVsbCk7CiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGRmLmNsaXBfZml4ZWQoKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIHdpbmRvdy5vdXRJbnRlcmNlcHQgPSBvdXRJbnRlcmNlcHRPbGQ7CgogICAgICAgICAgICAvLyBpZiAodGhpcy5jdHguX2NsaXBfcGF0aC5sZW5ndGggPiAwKSB7CiAgICAgICAgICAgIC8vICAgICBsaW5lcy5wdXNoKCdRJyk7CiAgICAgICAgICAgIC8vIH0KICAgICAgICB9LAoKICAgICAgICBwdXNoTWFzazogZnVuY3Rpb24gcHVzaE1hc2soKSB7CiAgICAgICAgICAgIHZhciB2MlN1cHBvcnQgPSB0eXBlb2YgdGhpcy5wZGYuaW50ZXJuYWwubmV3T2JqZWN0MiA9PT0gJ2Z1bmN0aW9uJzsKCiAgICAgICAgICAgIGlmICghdjJTdXBwb3J0KSB7CiAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygnanNQREYgdjIgbm90IGVuYWJsZWQnKTsKICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgLy8gZGVmaW5lIGEgbWFzayBzdHJlYW0KICAgICAgICAgICAgdmFyIG9iaiA9IHRoaXMucGRmLmludGVybmFsLm5ld1N0cmVhbU9iamVjdCgpOwoKICAgICAgICAgICAgLy8gZGVmaW5lIGEgbWFzayBzdGF0ZQogICAgICAgICAgICB2YXIgb2JqMiA9IHRoaXMucGRmLmludGVybmFsLm5ld09iamVjdDIoKTsKICAgICAgICAgICAgb2JqMi5wdXNoKCc8PC9UeXBlIC9FeHRHU3RhdGUnKTsKICAgICAgICAgICAgb2JqMi5wdXNoKCcvU01hc2sgPDwvUyAvQWxwaGEgL0cgJyArIG9iai5vYmpJZCArICcgMCBSPj4nKTsgLy8gL1MgL0x1bWlub3NpdHkgd2lsbCBuZWVkIHRvIGRlZmluZSBjb2xvciBzcGFjZQogICAgICAgICAgICBvYmoyLnB1c2goJz4+Jyk7CgogICAgICAgICAgICAvLyBhZGQgbWFzayB0byBwYWdlIHJlc291cmNlcwogICAgICAgICAgICB2YXIgZ3NOYW1lID0gJ01BU0snICsgb2JqMi5vYmpJZDsKICAgICAgICAgICAgdGhpcy5wZGYuaW50ZXJuYWwuYWRkR3JhcGhpY3NTdGF0ZShnc05hbWUsIG9iajIub2JqSWQpOwoKICAgICAgICAgICAgdmFyIGluc3RydWN0aW9uID0gJy8nICsgZ3NOYW1lICsgJyBncyc7CiAgICAgICAgICAgIHRoaXMucGRmLmludGVybmFsLm91dChpbnN0cnVjdGlvbik7CiAgICAgICAgfSwKCiAgICAgICAgY2xpcDogZnVuY3Rpb24gY2xpcCgpIHsKICAgICAgICAgICAgLy9UT0RPIGRvIHdlIHJlc2V0IHRoZSBwYXRoLCBvciBqdXN0IGNvcHkgaXQ/CiAgICAgICAgICAgIGlmICh0aGlzLmN0eC5fY2xpcF9wYXRoLmxlbmd0aCA+IDApIHsKICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgdGhpcy5wYXRoLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgICAgICAgICAgdGhpcy5jdHguX2NsaXBfcGF0aC5wdXNoKHRoaXMucGF0aFtpXSk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICB0aGlzLmN0eC5fY2xpcF9wYXRoID0gdGhpcy5wYXRoOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHRoaXMucGF0aCA9IFtdOwogICAgICAgIH0sCgogICAgICAgIG1lYXN1cmVUZXh0OiBmdW5jdGlvbiBtZWFzdXJlVGV4dCh0ZXh0KSB7CiAgICAgICAgICAgIHZhciBwZGYgPSB0aGlzLnBkZjsKICAgICAgICAgICAgcmV0dXJuIHsKICAgICAgICAgICAgICAgIGdldFdpZHRoOiBmdW5jdGlvbiBnZXRXaWR0aCgpIHsKICAgICAgICAgICAgICAgICAgICB2YXIgZm9udFNpemUgPSBwZGYuaW50ZXJuYWwuZ2V0Rm9udFNpemUoKTsKICAgICAgICAgICAgICAgICAgICB2YXIgdHh0V2lkdGggPSBwZGYuZ2V0U3RyaW5nVW5pdFdpZHRoKHRleHQpICogZm9udFNpemUgLyBwZGYuaW50ZXJuYWwuc2NhbGVGYWN0b3I7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHR4dFdpZHRoOwogICAgICAgICAgICAgICAgfSwKCiAgICAgICAgICAgICAgICBnZXQgd2lkdGgoKSB7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuZ2V0V2lkdGgodGV4dCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH07CiAgICAgICAgfSwKICAgICAgICBfZ2V0QmFzZWxpbmU6IGZ1bmN0aW9uIF9nZXRCYXNlbGluZSh5KSB7CiAgICAgICAgICAgIHZhciBoZWlnaHQgPSBwYXJzZUludCh0aGlzLnBkZi5pbnRlcm5hbC5nZXRGb250U2l6ZSgpKTsKICAgICAgICAgICAgLy8gVE9ETyBHZXQgZGVzY2VudCBmcm9tIGZvbnQgZGVzY3JpcHRvcgogICAgICAgICAgICB2YXIgZGVzY2VudCA9IGhlaWdodCAqIC4yNTsKICAgICAgICAgICAgc3dpdGNoICh0aGlzLmN0eC50ZXh0QmFzZWxpbmUpIHsKICAgICAgICAgICAgICAgIGNhc2UgJ2JvdHRvbSc6CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHkgLSBkZXNjZW50OwogICAgICAgICAgICAgICAgY2FzZSAndG9wJzoKICAgICAgICAgICAgICAgICAgICByZXR1cm4geSArIGhlaWdodDsKICAgICAgICAgICAgICAgIGNhc2UgJ2hhbmdpbmcnOgogICAgICAgICAgICAgICAgICAgIHJldHVybiB5ICsgaGVpZ2h0IC0gZGVzY2VudDsKICAgICAgICAgICAgICAgIGNhc2UgJ21pZGRsZSc6CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHkgKyBoZWlnaHQgLyAyIC0gZGVzY2VudDsKICAgICAgICAgICAgICAgIGNhc2UgJ2lkZW9ncmFwaGljJzoKICAgICAgICAgICAgICAgICAgICAvLyBUT0RPIG5vdCBpbXBsZW1lbnRlZAogICAgICAgICAgICAgICAgICAgIHJldHVybiB5OwogICAgICAgICAgICAgICAgY2FzZSAnYWxwaGFiZXRpYyc6CiAgICAgICAgICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgICAgICAgIHJldHVybiB5OwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfTsKCiAgICB2YXIgYzJkID0ganNQREZBUEkuY29udGV4dDJkOwoKICAgIC8vIGFjY2Vzc29yIG1ldGhvZHMKICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShjMmQsICdmaWxsU3R5bGUnLCB7CiAgICAgICAgc2V0OiBmdW5jdGlvbiBzZXQodmFsdWUpIHsKICAgICAgICAgICAgdGhpcy5zZXRGaWxsU3R5bGUodmFsdWUpOwogICAgICAgIH0sCiAgICAgICAgZ2V0OiBmdW5jdGlvbiBnZXQoKSB7CiAgICAgICAgICAgIHJldHVybiB0aGlzLmN0eC5maWxsU3R5bGU7CiAgICAgICAgfQogICAgfSk7CiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoYzJkLCAnc3Ryb2tlU3R5bGUnLCB7CiAgICAgICAgc2V0OiBmdW5jdGlvbiBzZXQodmFsdWUpIHsKICAgICAgICAgICAgdGhpcy5zZXRTdHJva2VTdHlsZSh2YWx1ZSk7CiAgICAgICAgfSwKICAgICAgICBnZXQ6IGZ1bmN0aW9uIGdldCgpIHsKICAgICAgICAgICAgcmV0dXJuIHRoaXMuY3R4LnN0cm9rZVN0eWxlOwogICAgICAgIH0KICAgIH0pOwogICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KGMyZCwgJ2xpbmVXaWR0aCcsIHsKICAgICAgICBzZXQ6IGZ1bmN0aW9uIHNldCh2YWx1ZSkgewogICAgICAgICAgICB0aGlzLnNldExpbmVXaWR0aCh2YWx1ZSk7CiAgICAgICAgfSwKICAgICAgICBnZXQ6IGZ1bmN0aW9uIGdldCgpIHsKICAgICAgICAgICAgcmV0dXJuIHRoaXMuY3R4LmxpbmVXaWR0aDsKICAgICAgICB9CiAgICB9KTsKICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShjMmQsICdsaW5lQ2FwJywgewogICAgICAgIHNldDogZnVuY3Rpb24gc2V0KHZhbCkgewogICAgICAgICAgICB0aGlzLnNldExpbmVDYXAodmFsKTsKICAgICAgICB9LAogICAgICAgIGdldDogZnVuY3Rpb24gZ2V0KCkgewogICAgICAgICAgICByZXR1cm4gdGhpcy5jdHgubGluZUNhcDsKICAgICAgICB9CiAgICB9KTsKICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShjMmQsICdsaW5lSm9pbicsIHsKICAgICAgICBzZXQ6IGZ1bmN0aW9uIHNldCh2YWwpIHsKICAgICAgICAgICAgdGhpcy5zZXRMaW5lSm9pbih2YWwpOwogICAgICAgIH0sCiAgICAgICAgZ2V0OiBmdW5jdGlvbiBnZXQoKSB7CiAgICAgICAgICAgIHJldHVybiB0aGlzLmN0eC5saW5lSm9pbjsKICAgICAgICB9CiAgICB9KTsKICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShjMmQsICdtaXRlckxpbWl0JywgewogICAgICAgIHNldDogZnVuY3Rpb24gc2V0KHZhbCkgewogICAgICAgICAgICB0aGlzLmN0eC5taXRlckxpbWl0ID0gdmFsOwogICAgICAgIH0sCiAgICAgICAgZ2V0OiBmdW5jdGlvbiBnZXQoKSB7CiAgICAgICAgICAgIHJldHVybiB0aGlzLmN0eC5taXRlckxpbWl0OwogICAgICAgIH0KICAgIH0pOwogICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KGMyZCwgJ3RleHRCYXNlbGluZScsIHsKICAgICAgICBzZXQ6IGZ1bmN0aW9uIHNldCh2YWx1ZSkgewogICAgICAgICAgICB0aGlzLnNldFRleHRCYXNlbGluZSh2YWx1ZSk7CiAgICAgICAgfSwKICAgICAgICBnZXQ6IGZ1bmN0aW9uIGdldCgpIHsKICAgICAgICAgICAgcmV0dXJuIHRoaXMuZ2V0VGV4dEJhc2VsaW5lKCk7CiAgICAgICAgfQogICAgfSk7CiAgICB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ID0gdHJ1ZTsKCiAgICAgICAgdmFyIGsgPSB0aGlzLnBkZi5pbnRlcm5hbC5zY2FsZUZhY3RvcjsKICAgICAgICB2YXIgcGFnZUhlaWdodCA9IHRoaXMucGRmLmludGVybmFsLnBhZ2VTaXplLmhlaWdodDsKICAgICAgICB2YXIgZjIgPSB0aGlzLnBkZi5pbnRlcm5hbC5mMjsKCiAgICAgICAgdmFyIGExciA9IGExICogKE1hdGguUEkgLyAxODApOwogICAgICAgIHZhciBhMnIgPSBhMiAqIChNYXRoLlBJIC8gMTgwKTsKICAgICAgICB2YXIgY3VydmVzID0gdGhpcy5jcmVhdGVBcmMociwgYTFyLCBhMnIsIGFudGljbG9ja3dpc2UpOwogICAgICAgIHZhciBwYXRoRGF0YSA9IG51bGw7CgogICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgY3VydmVzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgIHZhciBjdXJ2ZSA9IGN1cnZlc1tpXTsKICAgICAgICAgICAgaWYgKGluY2x1ZGVNb3ZlICYmIGkgPT0gMCkgewogICAgICAgICAgICAgICAgdGhpcy5wZGYuaW50ZXJuYWwub3V0KFtmMigoY3VydmUueDEgKyB4YykgKiBrKSwgZjIoKHBhZ2VIZWlnaHQgLSAoY3VydmUueTEgKyB5YykpICogayksICdtJywgZjIoKGN1cnZlLngyICsgeGMpICogayksIGYyKChwYWdlSGVpZ2h0IC0gKGN1cnZlLnkyICsgeWMpKSAqIGspLCBmMigoY3VydmUueDMgKyB4YykgKiBrKSwgZjIoKHBhZ2VIZWlnaHQgLSAoY3VydmUueTMgKyB5YykpICogayksIGYyKChjdXJ2ZS54NCArIHhjKSAqIGspLCBmMigocGFnZUhlaWdodCAtIChjdXJ2ZS55NCArIHljKSkgKiBrKSwgJ2MnXS5qb2luKCcgJykpOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgdGhpcy5wZGYuaW50ZXJuYWwub3V0KFtmMigoY3VydmUueDIgKyB4YykgKiBrKSwgZjIoKHBhZ2VIZWlnaHQgLSAoY3VydmUueTIgKyB5YykpICogayksIGYyKChjdXJ2ZS54MyArIHhjKSAqIGspLCBmMigocGFnZUhlaWdodCAtIChjdXJ2ZS55MyArIHljKSkgKiBrKSwgZjIoKGN1cnZlLng0ICsgeGMpICogayksIGYyKChwYWdlSGVpZ2h0IC0gKGN1cnZlLnk0ICsgeWMpKSAqIGspLCAnYyddLmpvaW4oJyAnKSk7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIC8vYzJkLl9sYXN0UG9pbnQgPSB7eDogY3VydmUueDEgKyB4YywgeTogY3VydmUueTEgKyB5Y307CiAgICAgICAgICAgIGMyZC5fbGFzdFBvaW50ID0geyB4OiB4YywgeTogeWMgfTsKICAgICAgICAgICAgLy8gZjIoKGN1cnZlLngxICsgeGMpICogayksIGYyKChwYWdlSGVpZ2h0IC0gKGN1cnZlLnkxICsgeWMpKSAqIGspLCAnbScsIGYyKChjdXJ2ZS54MiArIHhjKSAqIGspLCBmMigocGFnZUhlaWdodCAtIChjdXJ2ZS55MiArIHljKSkgKiBrKSwgZjIoKGN1cnZlLngzICsgeGMpICogayksIGYyKChwYWdlSGVpZ2h0IC0gKGN1cnZlLnkzICsgeWMpKSAqIGspLCBmMigoY3VydmUueDQgKyB4YykgKiBrKSwgZjIoKHBhZ2VIZWlnaHQgLSAoY3VydmUueTQgKyB5YykpICogayksICdjJwogICAgICAgIH0KCiAgICAgICAgaWYgKHN0eWxlICE9PSBudWxsKSB7CiAgICAgICAgICAgIHRoaXMucGRmLmludGVybmFsLm91dCh0aGlzLnBkZi5pbnRlcm5hbC5nZXRTdHlsZShzdHlsZSkpOwogICAgICAgIH0KICAgIH07CgogICAgLyoqCiAgICAgKgogICAgICogQHBhcmFtIHggRWRnZSBwb2ludCBYCiAgICAgKiBAcGFyYW0geSBFZGdlIHBvaW50IFkKICAgICAqIEBwYXJhbSByIFJhZGl1cwogICAgICogQHBhcmFtIGExIHN0YXJ0I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dXRpbmcgeDEseTEgYW5kIHg0LHk0CiAgICAgICAgLy8gYW5kIHJvdGF0aW5nIHRoZSBjb250cm9sIHBvaW50cyBieSBhICsgYTEKCiAgICAgICAgdmFyIGFyID0gYSArIGExOwogICAgICAgIHZhciBjb3NfYXIgPSBNYXRoLmNvcyhhcik7CiAgICAgICAgdmFyIHNpbl9hciA9IE1hdGguc2luKGFyKTsKCiAgICAgICAgcmV0dXJuIHsKICAgICAgICAgICAgeDE6IHIgKiBNYXRoLmNvcyhhMSksCiAgICAgICAgICAgIHkxOiByICogTWF0aC5zaW4oYTEpLAogICAgICAgICAgICB4MjogeDIgKiBjb3NfYXIgLSB5MiAqIHNpbl9hciwKICAgICAgICAgICAgeTI6IHgyICogc2luX2FyICsgeTIgKiBjb3NfYXIsCiAgICAgICAgICAgIHgzOiB4MyAqIGNvc19hciAtIHkzICogc2luX2FyLAogICAgICAgICAgICB5MzogeDMgKiBzaW5fYXIgKyB5MyAqIGNvc19hciwKICAgICAgICAgICAgeDQ6IHIgKiBNYXRoLmNvcyhhMiksCiAgICAgICAgICAgIHk0OiByICogTWF0aC5zaW4oYTIpCiAgICAgICAgfTsKICAgIH07CgogICAgZnVuY3Rpb24gY29udGV4dCgpIHsKICAgICAgICB0aGlzLl9pc1N0cm9rZVRyYW5zcGFyZW50ID0gZmFsc2U7CiAgICAgICAgdGhpcy5fc3Ryb2tlT3BhY2l0eSA9IDE7CiAgICAgICAgdGhpcy5zdHJva2VTdHlsZSA9ICcjMDAwMDAwJzsKICAgICAgICB0aGlzLmZpbGxTdHlsZSA9ICcjMDAwMDAwJzsKICAgICAgICB0aGlzLl9pc0ZpbGxUcmFuc3BhcmVudCA9IGZhbHNlOwogICAgICAgIHRoaXMuX2ZpbGxPcGFjaXR5ID0gMTsKICAgICAgICB0aGlzLmZvbnQgPSAiMTJwdCB0aW1lcyI7CiAgICAgICAgdGhpcy50ZXh0QmFzZWxpbmUgPSAnYWxwaGFiZXRpYyc7IC8vIHRvcCxib3R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ZpbGxPcGFjaXR5OwogICAgICAgICAgICB0aGlzLmZpbGxTdHlsZSA9IGN0eC5maWxsU3R5bGU7CiAgICAgICAgICAgIHRoaXMuZm9udCA9IGN0eC5mb250OwogICAgICAgICAgICB0aGlzLmxpbmVXaWR0aCA9IGN0eC5saW5lV2lkdGg7CiAgICAgICAgICAgIHRoaXMubGluZUpvaW4gPSBjdHgubGluZUpvaW47CiAgICAgICAgICAgIHRoaXMubGluZUNhcCA9IGN0eC5saW5lQ2FwOwogICAgICAgICAgICB0aGlzLnRleHRCYXNlbGluZSA9IGN0eC50ZXh0QmFzZWxpbmU7CiAgICAgICAgICAgIHRoaXMudGV4dEFsaWduID0gY3R4LnRleHRBbGlnbjsKICAgICAgICAgICAgdGhpcy5fZm9udFNpemUgPSBjdHguX2ZvbnRTaXplOwogICAgICAgICAgICB0aGlzLl90cmFuc2Zvcm0gPSBjdHguX3RyYW5zZm9ybS5zbGljZSgwKTsKICAgICAgICAgICAgdGhpcy5nbG9iYWxDb21wb3NpdGVPcGVyYXRpb24gPSBjdHguZ2xvYmFsQ29tcG9zaXRlT3BlcmF0aW9uOwogICAgICAgICAgICB0aGlzLmdsb2JhbEFscGhhID0gY3R4Lmdsb2JhbEFscGhhOwogICAgICAgICAgICB0aGlzLl9jbGlwX3BhdGggPSBjdHguX2NsaXBfcGF0aC5zbGljZSgwKTsgLy9UT0RPIGRlZXAgY29weT8KCiAgICAgICAgICAgIC8vIE5vdCBIVE1MIEFQSQogICAgICAgICAgICB0aGlzLmlnbm9yZUNsZWFyUmVjdCA9IGN0eC5pZ25vcmVDbGVhclJlY3Q7CiAgICAgICAgfTsKICAgIH0KCiAgICByZXR1cm4gdGhpczsKfSkoanNQREYuQVBJKTsKCi8qKiBAcHJlc2VydmUKICoganNQREYgZnJvbUhUTUwgcGx1Z2luLiBCRVRBIHN0YWdlLiBBUEkgc3ViamVjdCB0byBjaGFuZ2UuIE5lZWRzIGJyb3dzZXIKICogQ29weXJpZ2h0IChjKSAyM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ByZXR1cm5zIHtPYmplY3R9IGpzUERGIGluc3RhbmNlCiAgKi8KCWpzUERGQVBJLmZyb21IVE1MID0gZnVuY3Rpb24gKEhUTUwsIHgsIHksIHNldHRpbmdzLCBjYWxsYmFjaywgbWFyZ2lucykgewoJCSJ1c2Ugc3RyaWN0IjsKCgkJdGhpcy5tYXJnaW5zX2RvYyA9IG1hcmdpbnMgfHwgewoJCQl0b3A6IDAsCgkJCWJvdHRvbTogMAoJCX07CgkJaWYgKCFzZXR0aW5ncykgc2V0dGluZ3MgPSB7fTsKCQlpZiAoIXNldHRpbmdzLmVsZW1lbnRIYW5kbGVycykgc2V0dGluZ3MuZWxlbWVudEhhbmRsZXJzID0ge307CgoJCXJldHVybiBwcm9jZXNzKHRoaXMsIEhUTUwsIGlzTmFOKHgpID8gNCA6IHgsIGlzTmFOKHkpID8gNCA6IHksIHNldHRpbmdzLCBjYWxsYmFjayk7Cgl9Owp9KShqc1BERi5BUEkpOwoKLyoqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09IAogKiBqc1BERiBKYXZhU2NyaXB0IHBsdWdpbgogKiBDb3B5cmlnaHQgKGMpIDIwMTMgWW91c3NlZiBCZWRkYWQsIHlvdXNzZWYuYmVkZGFkQGdtYWlsLmNvbQogKiAKICogCiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAqLwoKLypnbG9iYWwganNQREYgKi8KCihmdW5jdGlvbiAoanNQREZBUEkpIHsKICAgICd1c2Ugc3RyaWN0JzsKCiAgICB2YXIganNOYW1lc09iaiwganNKc09iaiwgdGV4dDsKICAgIGpzUERGQVBJLmFkZEpTID0gZnVuY3Rpb24gKHR4dCkgewogICAgICAgIHRleHQgPSB0eHQ7CiAgICAgICAgdGhpcy5pbnRlcm5hbC5ldmVudHMuc3Vic2NyaWJlKCdwb3N0UHV0UmVzb3V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VzYXJnc1sxXSAvLyBzdGFydGluZyB5CgkJCQksIHNjYWxlKTsKCQkJfQoJCX0KCgkJLy8gY2xlYW4gdXAKCQkvLyB3b3JrZXJub2RlLnBhcmVudE5vZGUucmVtb3ZlQ2hpbGQod29ya2Vybm9kZSkKCgkJcmV0dXJuIHRoaXM7Cgl9Owp9KShqc1BERi5BUEkpOwoKLyoqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09IAogKiBqc1BERiB0b3RhbF9wYWdlcyBwbHVnaW4KICogQ29weXJpZ2h0IChjKSAyMDEzIEVkdWFyZG8gTWVuZXplcyBkZSBNb3JhaXMsIGVkdWFyZG8ubW9yYWlzQHVzcC5icgogKiAKICogCiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAqLwoKKGZ1bmN0aW9uIChqc1BERkFQSSkgewogICd1c2Ugc3RyaWN0JzsKCiAganNQREZBUEkucHV0VG90YWxQYWdlcyA9IGZ1bmN0aW9uIChwYWdlRXhwcmVzc2lvbikgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIHZhciByZXBsYWNlRXhwcmVzc2lvbiA9IG5ldyBSZWdFeHAocGFnZUV4cHJlc3Npb24sICdnJyk7CiAgICBmb3IgKHZhciBuID0gMTsgbiA8PSB0aGlzLmludGVybmFsLmdldE51bWJlck9mUGFnZXMoKTsgbisrKSB7CiAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgdGhpcy5pbnRlcm5hbC5wYWdlc1tuXS5sZW5ndGg7IGkrKykgewogICAgICAgIHRoaXMuaW50ZXJuYWwucGFnZXNbbl1baV0gPSB0aGlzLmludGVybmFsLnBhZ2VzW25dW2ldLnJlcGxhY2UocmVwbGFjZUV4cHJlc3Npb24sIHRoaXMuaW50ZXJuYWwuZ2V0TnVtYmVyT2ZQYWdlcygpKTsKICAgICAgfQogICAgfQogIC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lmIChvcHRpb25zLnR5cGUgPT09ICJ2aWV3IikgewogICAgICAgICAgICAgICAgICAgICAgICBjb250YWluZXIuY29udGVudFdpbmRvdy5zY3JvbGxUbyh4LCB5KTsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgvKGlQYWR8aVBob25lfGlQb2QpL2cpLnRlc3QobmF2aWdhdG9yLnVzZXJBZ2VudCkgJiYgKGNvbnRhaW5lci5jb250ZW50V2luZG93LnNjcm9sbFkgIT09IHkgfHwgY29udGFpbmVyLmNvbnRlbnRXaW5kb3cuc2Nyb2xsWCAhPT0geCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50Q2xvbmUuZG9jdW1lbnRFbGVtZW50LnN0eWxlLnRvcCA9ICgteSkgKyAicHgiOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnRDbG9uZS5kb2N1bWVudEVsZW1lbnQuc3R5bGUubGVmdCA9ICgteCkgKyAicHgiOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnRDbG9uZS5kb2N1bWVudEVsZW1lbnQuc3R5bGUucG9zaXRpb24gPSAnYWJzb2x1dGUnOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIHJlc29sdmUoY29udGFpbmVyKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSwgNTApOwogICAgICAgIH07CgogICAgICAgIGRvY3VtZW50Q2xvbmUub3BlbigpOwogICAgICAgIGRvY3VtZW50Q2xvbmUud3JpdGUoIjwhRE9DVFlQRSBodG1sPjxodG1sPjwvaHRtbD4iKTsKICAgICAgICAvLyBDaHJvbWUgc2Nyb2xscyB0aGUgcGFyZW50IGRvY3VtZW50IGZvciBzb21lIHJlYXNvbiBhZnRlciB0aGUgd3JpdGUgdG8gdGhlIGNsb25lZCB3aW5kb3c/Pz8KICAgICAgICByZXN0b3JlT3duZXJTY3JvbGwob3du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WdlTG9hZGVyLCBvcHRpb25zKTsKICAgIHJldHVybiBwYXJzZXIucmVhZHkudGhlbihmdW5jdGlvbigpIHsKICAgICAgICBsb2coIkZpbmlzaGVkIHJlbmRlcmluZyIpOwogICAgICAgIHZhciBjYW52YXM7CgogICAgICAgIGlmIChvcHRpb25zLnR5cGUgPT09ICJ2aWV3IikgewogICAgICAgICAgICBjYW52YXMgPSBjcm9wKHJlbmRlcmVyLmNhbnZhcywge3dpZHRoOiByZW5kZXJlci5jYW52YXMud2lkdGgsIGhlaWdodDogcmVuZGVyZXIuY2FudmFzLmhlaWdodCwgdG9wOiAwLCBsZWZ0OiAwLCB4OiAwLCB5OiAwfSk7CiAgICAgICAgfSBlbHNlIGlmIChub2RlID09PSBjbG9uZWRXaW5kb3cuZG9jdW1lbnQuYm9keSB8fCBub2RlID09PSBjbG9uZWRXaW5kb3cuZG9jdW1lbnQuZG9jdW1lbnRFbGVtZW50IHx8IG9wdGlvbnMuY2FudmFzICE9IG51bGwpIHsKICAgICAgICAgICAgY2FudmFzID0gcmVuZGVyZXIuY2FudmFzOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIGNhbnZhcyA9IGNyb3AocmVuZGVyZXIuY2FudmFzLCB7d2lkdGg6ICBvcHRpb25zLndpZHRoICE9IG51bGwgPyBvcHRpb25zLndpZHRoIDogYm91bmRzLndpZHRoLCBoZWlnaHQ6IG9wdGlvbnMuaGVpZ2h0ICE9IG51bGwgPyBvcHRpb25zLmhlaWdodCA6IGJvdW5kcy5oZWlnaHQsIHRvcDogYm91bmRzLnRvcCwgbGVmdDogYm91bmRzLmxlZnQsIHg6IDAsIHk6IDB9KTsKICAgICAgICB9CgogICAgICAgIGNsZWFudXBDb250YWluZXIoY29udGFpbmVyLCBvcHRpb25zKTsKICAgICAgICByZXR1cm4gY2FudmFzOwogICAgfSk7Cn0KCmZ1bmN0aW9uIGNsZWFudXBDb250YWluZXIoY29udGFpbmVyLCBvcHRpb25zKSB7CiAgICBpZi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c3ZnY29udGFpbmVyIjoyMywiLi9zdmdub2RlY29udGFpbmVyIjoyNCwiLi91dGlscyI6MjYsIi4vd2Via2l0Z3JhZGllbnRjb250YWluZXIiOjI3fV0sMTI6W2Z1bmN0aW9uKF9kZXJlcV8sbW9kdWxlLGV4cG9ydHMpewp2YXIgR3JhZGllbnRDb250YWluZXIgPSBfZGVyZXFfKCcuL2dyYWRpZW50Y29udGFpbmVyJyk7CnZhciBDb2xvciA9IF9kZXJlcV8oJy4vY29sb3InKTsKCmZ1bmN0aW9uIExpbmVhckdyYWRpZW50Q29udGFpbmVyKGltYWdlRGF0YSkgewogICAgR3JhZGllbnRDb250YWluZXIuYXBwbHkodGhpcywgYXJndW1lbnRzKTsKICAgIHRoaXMudHlwZSA9IEdyYWRpZW50Q29udGFpbmVyLlRZUEVTLkxJTkVBUjsKCiAgICB2YXIgaGFzRGlyZWN0aW9uID0gTGluZWFyR3JhZGllbnRDb250YWluZXIuUkVHRVhQX0RJUkVDVElPTi50ZXN0KCBpbWFnZURhdGEuYXJnc1swXSApIHx8CiAgICAgICAgIUdyYWRpZW50Q29udGFpbmVyLlJFR0VYUF9DT0xPUlNUT1AudGVzdCggaW1hZ2VEYXRhLmFyZ3NbMF0gKTsKCiAgICBpZiAoaGFzRGlyZWN0aW9uKSB7CiAgICAgICAgaW1hZ2VEYXRhLmFyZ3NbMF0uc3BsaXQoL1xzKy8pLnJldmVyc2UoKS5mb3JFYWNoKGZ1bmN0aW9uKHBvc2l0aW9uLCBpbmRleCkgewogICAgICAgICAgICBzd2l0Y2gocG9zaXRpb24pIHsKICAgICAgICAgICAgY2FzZSAibGVmdCI6CiAgICAgICAgICAgICAgICB0aGlzLngwID0gMDsKICAgICAgICAgICAgICAgIHRoaXMueDEgPSAxOwogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgInRvcCI6CiAgICAgICAgICAgICAgICB0aGlzLnkwID0gMDsKICAgICAgICAgICAgICAgIHRoaXMueTEgPSAxOwogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgInJpZ2h0IjoKICAgICAgICAgICAgICAgIHRoaXMueDAgPSAxOwogICAgICAgICAgICAgICAgdGhpcy54MSA9IDA7CiAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgY2FzZSAiYm90dG9tIjoKICAgICAgICAgICAgICAgIHRoaXMueTAgPSAxOwogICAgICAgICAgICAgICAgdGhpcy55MSA9IDA7CiAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgY2FzZSAidG8iOgogICAgICAgICAgICAgICAgdmFyIHkwID0gdGhpcy55MDsKICAgICAgICAgICAgICAgIHZhciB4MCA9IHRoaXMueDA7CiAgICAgICAgICAgICAgICB0aGlzLnkwID0gdGhpcy55MTsKICAgICAgICAgICAgICAgIHRoaXMueDAgPSB0aGlzLngxOwogICAgICAgICAgICAgICAgdGhpcy54MSA9IHgwOwogICAgICAgICAgICAgICAgdGhpcy55MSA9IHkwOwogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgImNlbnRlciI6CiAgICAgICAgICAgICAgICBicmVhazsgLy8gY2VudGVyZWQgYnkgZGVmYXVsdAogICAgICAgICAgICAvLyBGaXJlZm94IGludGVybmFsbHkgY29udmVydHMgcG9zaXRpb24ga2V5d29yZHMgdG8gcGVyY2VudGFnZXM6CiAgICAgICAgICAgIC8vIGh0dHA6Ly93d3cudzMub3JnL1RSLzIwMTAvV0QtQ1NTMi0yMDEwMTIwNy9jb2xvcnMuaHRtbCNwcm9wZGVmLWJhY2tncm91bmQtcG9zaXRpb24KICAgICAgICAgICAgZGVmYXVsdDogLy8gcGVyY2VudGFnZSBvciBhYnNvbHV0ZSBsZW5ndGgKICAgICAgICAgICAgICAgIC8vIFRPRE86IHN1cHBvcnQgYWJzb2x1dGUgc3RhcnQgcG9pbnQgcG9zaXRpb25zIChlLmcuLCB1c2UgYm91bmRzIHRvIGNvbnZlcnQgcHggdG8gYSByYXRpbykKICAgICAgICAgICAgICAgIHZhciByYXRpbyA9IHBhcnNlRmxvYXQocG9zaXRpb24sIDEwKSAqIDFlLTI7CiAgICAgICAgICAgICAgICBpZiAoaXNOYU4ocmF0aW8pKSB7IC8vIGludmFsaWQgb3IgdW5oYW5kbGVkIHZhbHVlCiAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBpZiAoaW5kZXggPT09IDApIHsKICAgICAgICAgICAgICAgICAgICB0aGlzLnkwID0gcmF0aW87CiAgICAgICAgICAgICAgICAgICAgdGhpcy55MSA9IDEgLSB0aGlzLnkwOwogICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICB0aGlzLngwID0gcmF0aW87CiAgICAgICAgICAgICAgICAgICAgdGhpcy54MSA9IDEgLSB0aGlzLngwOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIH0KICAgICAgICB9LCB0aGlzKTsKICAgIH0gZWxzZSB7CiAgICAgICAgdGhpcy55MCA9IDA7CiAgICAgICAgdGhpcy55MSA9IDE7CiAgICB9CgogICAgdGhpcy5jb2xvclN0b3BzID0gaW1hZ2VEYXRhLmFyZ3Muc2xpY2UoaGFzRGlyZWN0aW9uID8gMSA6IDApLm1hcChmdW5jdGlvbihjb2xvclN0b3ApIHsKICAgICAgICB2YXIgY29sb3JTdG9wTWF0Y2ggPSBjb2xvclN0b3AubWF0Y2goR3JhZGllbnRDb250YWluZXIuUkVHRVhQX0NPTE9SU1RPUCk7CiAgICAgICAgdmFyIHZhbHVlID0gK2NvbG9yU3RvcE1hdGNoWzJdOwogICAgICAgIHZhciB1bml0ID0gdmFsdWUgPT09IDAgPyAiJSIgOiBjb2xvclN0b3BNYXRjaFszXTsgLy8gdHJlYXQgIjAiIGFzICIwJSIKICAgICAgICByZXR1cm4gewogICAgICAgICAgICBjb2xvcjogbmV3IENvbG9yKGNvb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idGV4dFNoYWRvdyIpOwogICAgdmFyIHJlc3VsdHMgPSBbXTsKCiAgICBpZiAodGV4dFNoYWRvdyAmJiB0ZXh0U2hhZG93ICE9PSAnbm9uZScpIHsKICAgICAgICB2YXIgc2hhZG93cyA9IHRleHRTaGFkb3cubWF0Y2godGhpcy5URVhUX1NIQURPV19QUk9QRVJUWSk7CiAgICAgICAgZm9yICh2YXIgaSA9IDA7IHNoYWRvd3MgJiYgKGkgPCBzaGFkb3dzLmxlbmd0aCk7IGkrKykgewogICAgICAgICAgICB2YXIgcyA9IHNoYWRvd3NbaV0ubWF0Y2godGhpcy5URVhUX1NIQURPV19WQUxVRVMpOwogICAgICAgICAgICByZXN1bHRzLnB1c2goewogICAgICAgICAgICAgICAgY29sb3I6IG5ldyBDb2xvcihzWzBdKSwKICAgICAgICAgICAgICAgIG9mZnNldFg6IHNbMV0gPyBwYXJzZUZsb2F0KHNbMV0ucmVwbGFjZSgncHgnLCAnJykpIDogMCwKICAgICAgICAgICAgICAgIG9mZnNldFk6IHNbMl0gPyBwYXJzZUZsb2F0KHNbMl0ucmVwbGFjZSgncHgnLCAnJykpIDogMCwKICAgICAgICAgICAgICAgIGJsdXI6IHNbM10gPyBzWzNdLnJlcGxhY2UoJ3B4JywgJycpIDogMAogICAgICAgICAgICB9KTsKICAgICAgICB9CiAgICB9CiAgICByZXR1cm4gcmVzdWx0czsKfTsKCk5vZGVDb250YWluZXIucHJvdG90eXBlLnBhcnNlVHJhbnNmb3JtID0gZnVuY3Rpb24oKSB7CiAgICBpZiAoIXRoaXMudHJhbnNmb3JtRGF0YSkgewogICAgICAgIGlmICh0aGlzLmhhc1RyYW5zZm9ybSgpKSB7CiAgICAgICAgICAgIHZhciBvZmZzZXQgPSB0aGlzLnBhcnNlQm91bmRzKCk7CiAgICAgICAgICAgIHZhciBvcmlnaW4gPSB0aGlzLnByZWZpeGVkQ3NzKCJ0cmFuc2Zvcm1PcmlnaW4iKS5zcGxpdCgiICIpLm1hcChyZW1vd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MgPSBmdW5jdGlvbigpIHsKICAgIHRoaXMubm9kZXMuZm9yRWFjaChmdW5jdGlvbihjb250YWluZXIpIHsKICAgICAgICBpZiAoaXNFbGVtZW50KGNvbnRhaW5lcikpIHsKICAgICAgICAgICAgaWYgKGlzUHNldWRvRWxlbWVudChjb250YWluZXIpKSB7CiAgICAgICAgICAgICAgICBjb250YWluZXIuYXBwZW5kVG9ET00oKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBjb250YWluZXIuYm9yZGVycyA9IHRoaXMucGFyc2VCb3JkZXJzKGNvbnRhaW5lcik7CiAgICAgICAgICAgIHZhciBjbGlwID0gKGNvbnRhaW5lci5jc3MoJ292ZXJmbG93JykgPT09ICJoaWRkZW4iKSA/IFtjb250YWluZXIuYm9yZGVycy5jbGlwXSA6IFtdOwogICAgICAgICAgICB2YXIgY3NzQ2xpcCA9IGNvbnRhaW5lci5wYXJzZUNsaXAoKTsKICAgICAgICAgICAgaWYgKGNzc0NsaXAgJiYgWyJhYnNvbHV0ZSIsICJmaXhlZCJdLmluZGV4T2YoY29udGFpbmVyLmNzcygncG9zaXRpb24nKSkgIT09IC0xKSB7CiAgICAgICAgICAgICAgICBjbGlwLnB1c2goW1sicmVjdCIsCiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRhaW5lci5ib3VuZHMubGVmdCArIGNzc0NsaXAubGVmdCwKICAgICAgICAgICAgICAgICAgICAgICAgY29udGFpbmVyLmJvdW5kcy50b3AgKyBjc3NDbGlwLnRvcCwKICAgICAgICAgICAgICAgICAgICAgICAgY3NzQ2xpcC5yaWdodCAtIGNzc0NsaXAubGVmdCwKICAgICAgICAgICAgICAgICAgICAgICAgY3NzQ2xpcC5ib3R0b20gLSBjc3NDbGlwLnRvcAogICAgICAgICAgICAgICAgXV0pOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGNvbnRhaW5lci5jbGlwID0gaGFzUGFyZW50Q2xpcChjb250YWluZXIpID8gY29udGFpbmVyLnBhcmVudC5jbGlwLmNvbmNhdChjbGlwKSA6IGNsaXA7CiAgICAgICAgICAgIGNvbnRhaW5lci5iYWNrZ3JvdW5kQ2xpcCA9IChjb250YWluZXIuY3NzKCdvdmVyZmxvdycpICE9PSAiaGlkZGVuIikgPyBjb250YWluZXIuY2xpcC5jb25jYXQoW2NvbnRhaW5lci5ib3JkZXJzLmNsaXBdKSA6IGNvbnRhaW5lci5jbGlwOwogICAgICAgICAgICBpZiAoaXNQc2V1ZG9FbGVtZW50KGNvbnRhaW5lcikpIHsKICAgICAgICAgICAgICAgIGNvbnRhaW5lci5jbGVhbkRPTSgpOwogICAgICAgICAgICB9CiAgICAgICAgfSBlbHNlIGlmIChpc1RleHROb2RlKGNvbnRhaW5lcikpIHsKICAgICAgICAgICAgY29udGFpbmVyLmNsaXAgPSBoYXNQYXJlbnRDbGlwKGNvbnRhaW5lcikgPyBjb250YWluZXIucGFyZW50LmNsaXAgOiBbXTsKICAgICAgICB9CiAgICAgICAgaWYgKCFpc1BzZXVkb0VsZW1lbnQoY29udGFpbmVyKSkgewogICAgICAgICAgICBjb250YWluZXIuYm91bmRzID0gbnVsbDsKICAgICAgICB9CiAgICB9LCB0aGlzKTsKfTsKCmZ1bmN0aW9uIGhhc1BhcmVudENsaXAoY29udGFpbmVyKSB7CiAgICByZXR1cm4gY29udGFpbmVyLnBhcmVudCAmJiBjb250YWluZXIucGFyZW50LmNsaXAubGVuZ3RoOwp9CgpOb2RlUGFyc2VyLnByb3RvdHlwZS5hc3luY1JlbmRlcmVyID0gZnVuY3Rpb24ocXVldWUsIHJlc29sdmUsIGFzeW5jVGltZXIpIHsKICAgIGFzeW5jVGltZXIgPSBhc3luY1RpbWVyIHx8IERhdGUubm93KCk7CiAgICB0aGlzLnBhaW50KHF1ZXVlW3RoaXMucmVuZGVySW5kZXgrK10pOwogICAgaWYgKHF1ZXVlLmxlbmd0aCA9PT0gdGhpcy5yZW5kZXJJbmRleCkgewogICAgICAgIHJlc29sdmUoKTsKICAgIH0gZWxzZS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ICAgcmV0dXJuIG5vZGUubm9kZVR5cGUgPT09IE5vZGUuRUxFTUVOVF9OT0RFICYmIGNvbnRhaW5lci5sZW5ndGggJiYgbm9kZS50YWdOYW1lICE9PSAiVEVYVEFSRUEiID8gKGNvbnRhaW5lclswXS5pc0VsZW1lbnRWaXNpYmxlKCkgPyBjb250YWluZXIuY29uY2F0KHRoaXMuZ2V0Q2hpbGRyZW4oY29udGFpbmVyWzBdKSkgOiBbXSkgOiBjb250YWluZXI7CiAgICB9LCB0aGlzKSk7Cn07CgpOb2RlUGFyc2VyLnByb3RvdHlwZS5uZXdTdGFja2luZ0NvbnRleHQgPSBmdW5jdGlvbihjb250YWluZXIsIGhhc093blN0YWNraW5nKSB7CiAgICB2YXIgc3RhY2sgPSBuZXcgU3RhY2tpbmdDb250ZXh0KGhhc093blN0YWNraW5nLCBjb250YWluZXIuZ2V0T3BhY2l0eSgpLCBjb250YWluZXIubm9kZSwgY29udGFpbmVyLnBhcmVudCk7CiAgICBjb250YWluZXIuY2xvbmVUbyhzdGFjayk7CiAgICB2YXIgcGFyZW50U3RhY2sgPSBoYXNPd25TdGFja2luZyA/IHN0YWNrLmdldFBhcmVudFN0YWNrKHRoaXMpIDogc3RhY2sucGFyZW50LnN0YWNrOwogICAgcGFyZW50U3RhY2suY29udGV4dHMucHVzaChzdGFjayk7CiAgICBjb250YWluZXIuc3RhY2sgPSBzdGFjazsKfTsKCk5vZGVQYXJzZXIucHJvdG90eXBlLmNyZWF0ZVN0YWNraW5nQ29udGV4dHMgPSBmdW5jdGlvbigpIHsKICAgIHRoaXMubm9kZXMuZm9yRWFjaChmdW5jdGlvbihjb250YWluZXIpIHsKICAgICAgICBpZiAoaXNFbGVtZW50KGNvbnRhaW5lcikgJiYgKHRoaXMuaXNSb290RWxlbWVudChjb250YWluZXIpIHx8IGhhc09wYWNpdHkoY29udGFpbmVyKSB8fCBpc1Bvc2l0aW9uZWRGb3JTdGFja2luZyhjb250YWluZXIpIHx8IHRoaXMuaXNCb2R5V2l0aFRyYW5zcGFyZW50Um9vdChjb250YWluZXIpIHx8IGNvbnRhaW5lci5oYXNUcmFuc2Zvcm0oKSkpIHsKICAgICAgICAgICAgdGhpcy5uZXdTdGFja2luZ0NvbnRleHQoY29udGFpbmVyLCB0cnVlKTsKICAgICAgICB9IGVsc2UgaWYgKGlzRWxlbWVudChjb250YWluZXIpICYmICgoaXNQb3NpdGlvbmVkKGNvbnRhaW5lcikgJiYgekluZGV4MChjb250YWluZXIpKSB8fCBpc0lubGluZUJsb2NrKGNvbnRhaW5lcikgfHwgaXNGbG9hdGluZyhjb250YWluZXIpKSkgewogICAgICAgICAgICB0aGlzLm5ld1N0YWNraW5nQ29udGV4dChjb250YWluZXIsIGZhbHNlKTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBjb250YWluZXIuYXNzaWduU3RhY2soY29udGFpbmVyLnBhcmVudC5zdGFjayk7CiAgICAgICAgfQogICAgfSwgdGhpcyk7Cn07CgpOb2RlUGFyc2VyLnByb3RvdHlwZS5pc0JvZHlXaXRoVHJhbnNwYXJlbnRSb290ID0gZnVuY3Rpb24oY29udGFpbmVyKSB7CiAgICByZXR1cm4gY29udGFpbmVyLm5vZGUubm9kZU5hbWUgPT09ICJCT0RZIiAmJiBjb250YWluZXIucGFyZW50LmNvbG9yKCdiYWNrZ3JvdW5kQ29sb3InKS5pc1RyYW5zcGFyZW50KCk7Cn07CgpOb2RlUGFyc2VyLnByb3RvdHlwZS5pc1Jvb3RFbGVtZW50ID0gZnVuY3Rpb24oY29udGFpbmVyKSB7CiAgICByZXR1cm4gY29udGFpbmVyLnBhcmVudCA9PT0gbnVsbDsKfTsKCk5vZGVQYXJzZXIucHJvdG90eXBlLnNvcnRTdGFja2luZ0NvbnRleHRzID0gZnVuY3Rpb24oc3RhY2spIHsKICAgIHN0YWNrLmNvbnRleHRzLnNvcnQoekluZGV4U29ydChzdGFjay5jb250ZXh0cy5zbGljZSgwKSkpOwogICAgc3RhY2suY29udGV4dHMu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ICAgICAgICAgICAgdGhpcy5yZW5kZXJRdWV1ZS5wdXNoKGNvbnRhaW5lcik7CiAgICAgICAgICAgIGlmIChpc1N0YWNraW5nQ29udGV4dChjb250YWluZXIpKSB7CiAgICAgICAgICAgICAgICB0aGlzLnBhcnNlKGNvbnRhaW5lcik7CiAgICAgICAgICAgICAgICB0aGlzLnJlbmRlclF1ZXVlLnB1c2gobmV3IENsZWFyVHJhbnNmb3JtKCkpOwogICAgICAgICAgICB9CiAgICAgICAgfSwgdGhpcyk7Cn07CgpOb2RlUGFyc2VyLnByb3RvdHlwZS5wYWludCA9IGZ1bmN0aW9uKGNvbnRhaW5lcikgewogICAgdHJ5IHsKICAgICAgICBpZiAoY29udGFpbmVyIGluc3RhbmNlb2YgQ2xlYXJUcmFuc2Zvcm0pIHsKICAgICAgICAgICAgdGhpcy5yZW5kZXJlci5jdHgucmVzdG9yZSgpOwogICAgICAgIH0gZWxzZSBpZiAoaXNUZXh0Tm9kZShjb250YWluZXIpKSB7CiAgICAgICAgICAgIGlmIChpc1BzZXVkb0VsZW1lbnQoY29udGFpbmVyLnBhcmVudCkpIHsKICAgICAgICAgICAgICAgIGNvbnRhaW5lci5wYXJlbnQuYXBwZW5kVG9ET00oKTsKICAgICAgICAgICAgfQogICAgICAgICAgICB0aGlzLnBhaW50VGV4dChjb250YWluZXIpOwogICAgICAgICAgICBpZiAoaXNQc2V1ZG9FbGVtZW50KGNvbnRhaW5lci5wYXJlbnQpKSB7CiAgICAgICAgICAgICAgICBjb250YWluZXIucGFyZW50LmNsZWFuRE9NKCk7CiAgICAgICAgICAgIH0KICAgICAgICB9IGVsc2UgewogICAgICAgICAgICB0aGlzLnBhaW50Tm9kZShjb250YWluZXIpOwogICAgICAgIH0KICAgIH0gY2F0Y2goZSkgewogICAgICAgIGxvZyhlKTsKICAgICAgICBpZiAodGhpcy5vcHRpb25zLnN0cmljdCkgewogICAgICAgICAgICB0aHJvdyBlOwogICAgICAgIH0KICAgIH0KfTsKCk5vZGVQYXJzZXIucHJvdG90eXBlLnBhaW50Tm9kZSA9IGZ1bmN0aW9uKGNvbnRhaW5lcikgewogICAgaWYgKGlzU3RhY2tpbmdDb250ZXh0KGNvbnRhaW5lcikpIHsKICAgICAgICB0aGlzLnJlbmRlcmVyLnNldE9wYWNpdHkoY29udGFpbmVyLm9wYWNpdHkpOwogICAgICAgIHRoaXMucmVuZGVyZXIuY3R4LnNhdmUoKTsKICAgICAgICBpZiAoY29udGFpbmVyLmhhc1RyYW5zZm9ybSgpKSB7CiAgICAgICAgICAgIHRoaXMucmVuZGVyZXIuc2V0VHJhbnNmb3JtKGNvbnRhaW5lci5wYXJzZVRyYW5zZm9ybSgpKTsKICAgICAgICB9CiAgICB9CgogICAgaWYgKGNvbnRhaW5lci5ub2RlLm5vZGVOYW1lID09PSAiSU5QVVQiICYmIGNvbnRhaW5lci5ub2RlLnR5cGUgPT09ICJjaGVja2JveCIpIHsKICAgICAgICB0aGlzLnBhaW50Q2hlY2tib3goY29udGFpbmVyKTsKICAgIH0gZWxzZSBpZiAoY29udGFpbmVyLm5vZGUubm9kZU5hbWUgPT09ICJJTlBVVCIgJiYgY29udGFpbmVyLm5vZGUudHlwZSA9PT0gInJhZGlvIikgewogICAgICAgIHRoaXMucGFpbnRSYWRpbyhjb250YWluZXIpOwogICAgfSBlbHNlIHsKICAgICAgICB0aGlzLnBhaW50RWxlbWVudChjb250YWluZXIpOwogICAgfQp9OwoKTm9kZVBhcnNlci5wcm90b3R5cGUucGFpbnRFbGVtZW50ID0gZnVuY3Rpb24oY29udGFpbmVyKSB7CiAgICB2YXIgYm91bmRzID0gY29udGFpbmVyLnBhcnNlQm91bmRzKCk7CiAgICB0aGlzLnJlbmRlcmVyLmNsaXAoY29udGFpbmVyLmJhY2tncm91bmRDbGlwLCBmdW5jdGlvbigpIHsKICAgICAgICB0aGlzLnJlbmRlcmVyLnJlbmRlckJhY2tncm91bmQoY29udGFpbmVyLCBib3VuZHMsIGNvbnRhaW5lci5ib3JkZXJzLmJvcmRlcnMubWFwKGdldFdpZHRoKSk7CiAgICB9LCB0aGlzKTsKCiAgICB0aGlzLnJlbmRlcmVyLmNsaXAoY29udGFpbmVyLmNsaXAsIGZ1bmN0aW9uKCkgewogICAgICAgIHRoaXMucmVuZGVyZXIucmVuZGVyQm9yZGVycyhjb250YWluZXIuYm9yZGVycy5ib3JkZXJzKTsKICAgIH0sIHRoaXMpOwoKICAgIHRoaXMucmVuZGVyZXIuY2xpcChjb250YWluZXIuYmFja2dyb3VuZENsaXAsIGZ1bmN0aW9uKCkgewogICAgICAgIHN3aXRjaCAoY29udGFpbmVyLm5vZGUubm9kZU5hbWUpIHsKICAgICAgICBjYXNlICJzdmciOgogICAgICAgIGNhc2UgIklGUkFNRSI6CiAgICAgICAgICAgIHZhciBpbWdDb250YWluZXIgPSB0aGlzLmltYWdlcy5nZXQoY29udGFpbmVyLm5vZGUpOwogICAgICAgICAgICBpZiAoaW1nQ29udGFpbmVyKSB7CiAgICAgICAgICAgICAgICB0aGlzLnJlbmRlcmVyLnJlbmRlckltYWdlKGNvbnRhaW5lciwgYm91bmRzLCBjb250YWluZXIuYm9yZGVycywgaW1nQ29udGFpbmVyKTsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIGxvZygiRXJyb3IgbG9hZGluZyA8IiArIGNvbnRhaW5lci5ub2RlLm5vZGVOYW1lICsgIj4iLCBjb250YWluZXIubm9kZSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgY2FzZSAiSU1HIjoKICAgICAgICAgICAgdmFyIGltYWdlQ29udGFpbmVyID0gdGhpcy5pbWFnZXMuZ2V0KGNvbnRhaW5lci5ub2RlLnNyYyk7CiAgICAgICAgICAgIGlmIChpbWFnZUNvbnRhaW5lcikgewogICAgICAgICAgICAgICAgdGhpcy5yZW5kZXJlci5yZW5kZXJJbWFnZShjb250YWluZXIsIGJvdW5kcywgY29udGFpbmVyLmJvcmRlcnMsIGltYWdl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HRoJywgJ2JvcmRlclRvcFdpZHRoJywKICAgICAgICAgICAgJ2JveFNpemluZycsICd3aGl0ZVNwYWNlJywgJ3dvcmRXcmFwJ107CgogICAgICAgIHByb3BlcnRpZXMuZm9yRWFjaChmdW5jdGlvbihwcm9wZXJ0eSkgewogICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgd3JhcHBlci5zdHlsZVtwcm9wZXJ0eV0gPSBjb250YWluZXIuY3NzKHByb3BlcnR5KTsKICAgICAgICAgICAgfSBjYXRjaChlKSB7CiAgICAgICAgICAgICAgICAvLyBPbGRlciBJRSBoYXMgaXNzdWVzIHdpdGggImJvcmRlciIKICAgICAgICAgICAgICAgIGxvZygiaHRtbDJjYW52YXM6IFBhcnNlOiBFeGNlcHRpb24gY2F1Z2h0IGluIHJlbmRlckZvcm1WYWx1ZTogIiArIGUubWVzc2FnZSk7CiAgICAgICAgICAgIH0KICAgICAgICB9KTsKICAgICAgICB2YXIgYm91bmRzID0gY29udGFpbmVyLnBhcnNlQm91bmRzKCk7CiAgICAgICAgd3JhcHBlci5zdHlsZS5wb3NpdGlvbiA9ICJmaXhlZCI7CiAgICAgICAgd3JhcHBlci5zdHlsZS5sZWZ0ID0gYm91bmRzLmxlZnQgKyAicHgiOwogICAgICAgIHdyYXBwZXIuc3R5bGUudG9wID0gYm91bmRzLnRvcCArICJweCI7CiAgICAgICAgd3JhcHBlci50ZXh0Q29udGVudCA9IHZhbHVlOwogICAgICAgIGRvY3VtZW50LmJvZHkuYXBwZW5kQ2hpbGQod3JhcHBlcik7CiAgICAgICAgdGhpcy5wYWludFRleHQobmV3IFRleHRDb250YWluZXIod3JhcHBlci5maXJzdENoaWxkLCBjb250YWluZXIpKTsKICAgICAgICBkb2N1bWVudC5ib2R5LnJlbW92ZUNoaWxkKHdyYXBwZXIpOwogICAgfQp9OwoKTm9kZVBhcnNlci5wcm90b3R5cGUucGFpbnRUZXh0ID0gZnVuY3Rpb24oY29udGFpbmVyKSB7CiAgICBjb250Y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gdG8gdGFrZSB0aGF0IGludG8gYWNjb3VudCBib3RoIGluIHBvc2l0aW9uIGFuZCBzaXplCiAgICAgICAgdGhpcy5yZW5kZXJlci5yZWN0YW5nbGUoYm91bmRzLmxlZnQsIE1hdGgucm91bmQoYm91bmRzLnRvcCArIG1ldHJpY3MuYmFzZWxpbmUgKyBtZXRyaWNzLmxpbmVXaWR0aCksIGJvdW5kcy53aWR0aCwgMSwgY29udGFpbmVyLmNvbG9yKCJjb2xvciIpKTsKICAgICAgICBicmVhazsKICAgIGNhc2UgIm92ZXJsaW5lIjoKICAgICAgICB0aGlzLnJlbmRlcmVyLnJlY3RhbmdsZShib3VuZHMubGVmdCwgTWF0aC5yb3VuZChib3VuZHMudG9wKSwgYm91bmRzLndpZHRoLCAxLCBjb250YWluZXIuY29sb3IoImNvbG9yIikpOwogICAgICAgIGJyZWFrOwogICAgY2FzZSAibGluZS10aHJvdWdoIjoKICAgICAgICAvLyBUT0RPIHRyeSBhbmQgZmluZCBleGFjdCBwb3NpdGlvbiBmb3IgbGluZS10aHJvdWdoCiAgICAgICAgdGhpcy5yZW5kZXJlci5yZWN0YW5nbGUoYm91bmRzLmxlZnQsIE1hdGguY2VpbChib3VuZHMudG9wICsgbWV0cmljcy5taWRkbGUgKyBtZXRyaWNzLmxpbmVXaWR0aCksIGJvdW5kcy53aWR0aCwgMSwgY29udGFpbmVyLmNvbG9yKCJjb2xvciIpKTsKICAgICAgICBicmVhazsKICAgIH0KfTsKCnZhciBib3JkZXJDb2xvclRyYW5zZm9ybXMgPSB7CiAgICBpbnNldDogWwogICAgICAgIFsiZGFya2VuIiwgMC42MF0sCiAgICAgICAgWyJkYXJrZW4iLCAwLjEwXSwKICAgICAgICBbImRhcmtlbiIsIDAuMTBdLAogICAgICAgIFsiZGFya2VuIiwgMC42MF0KICAgIF0KfTsKCk5vZGVQYXJzZXIucHJvdG90eXBlLnBhcnNlQm9yZGVycyA9IGZ1bmN0aW9uKGNvbnRhaW5lcikgewogICAgdmF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mV0dXJuIHsKICAgICAgICBjbGlwOiB0aGlzLnBhcnNlQmFja2dyb3VuZENsaXAoY29udGFpbmVyLCBib3JkZXJQb2ludHMsIGJvcmRlcnMsIHJhZGl1cywgbm9kZUJvdW5kcyksCiAgICAgICAgYm9yZGVyczogY2FsY3VsYXRlQm9yZGVycyhib3JkZXJzLCBub2RlQm91bmRzLCBib3JkZXJQb2ludHMsIHJhZGl1cykKICAgIH07Cn07CgpmdW5jdGlvbiBjYWxjdWxhdGVCb3JkZXJzKGJvcmRlcnMsIG5vZGVCb3VuZHMsIGJvcmRlclBvaW50cywgcmFkaXVzKSB7CiAgICByZXR1cm4gYm9yZGVycy5tYXAoZnVuY3Rpb24oYm9yZGVyLCBib3JkZXJTaWRlKSB7CiAgICAgICAgaWYgKGJvcmRlci53aWR0aCA+IDApIHsKICAgICAgICAgICAgdmFyIGJ4ID0gbm9kZUJvdW5kcy5sZWZ0OwogICAgICAgICAgICB2YXIgYnkgPSBub2RlQm91bmRzLnRvcDsKICAgICAgICAgICAgdmFyIGJ3ID0gbm9kZUJvdW5kcy53aWR0aDsKICAgICAgICAgICAgdmFyIGJoID0gbm9kZUJvdW5kcy5oZWlnaHQgLSAoYm9yZGVyc1syXS53aWR0aCk7CgogICAgICAgICAgICBzd2l0Y2goYm9yZGVyU2lkZSkgewogICAgICAgICAgICBjYXNlIDA6CiAgICAgICAgICAgICAgICAvLyB0b3AgYm9yZGVyCiAgICAgICAgICAgICAgICBiaCA9IGJvcmRlcnNbMF0ud2lkdGg7CiAgICAgICAgICAgICAgICBib3JkZXIuYXJncyA9IGRyYXdTaWRlKHsKICAgICAgICAgICAgICAgICAgICAgICAgYzE6IFtieCwgYnldLAogICAgICAgICAgICAgICAgICAgICAgICBjMjogW2J4ICsgYncsIGJ5XSwKICAgICAgICAgICAgICAgICAgICAgICAgYzM6IFtieCArIGJ3IC0gYm9yZGVyc1sxXS53aWR0aCwgYnkgKyBiaF0sCiAgICAgICAgICAgICAgICAgICAgICAgIGM0OiBbYnggKyBib3JkZXJzWzNdLndpZHRoLCBieSArIGJoXQogICAgICAgICAgICAgICAgICAgIH0sIHJhZGl1c1swXSwgcmFkaXVzWzFdLAogICAgICAgICAgICAgICAgICAgIGJvcmRlclBvaW50cy50b3BMZWZ0T3V0ZXIsIGJvcmRlclBvaW50cy50b3BMZWZ0SW5uZXIsIGJvcmRlclBvaW50cy50b3BSaWdodE91dGVyLCBib3JkZXJQb2ludHMudG9wUmlnaHRJbm5lcik7CiAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgY2FzZSAxOgogICAgICAgICAgICAgICAgLy8gcmlnaHQgYm9yZGVyCiAgICAgICAgICAgICAgICBieCA9IG5vZGVCb3VuZHMubGVmdCArIG5vZGVCb3VuZHMud2lkdGggLSAoYm9yZGVyc1sxXS53aWR0aCk7CiAgICAgICAgICAgICAgICBidyA9IGJvcmRlcnNbMV0ud2lkdGg7CgogICAgICAgICAgICAgICAgYm9yZGVyLmFyZ3MgPSBkcmF3U2lkZSh7CiAgICAgICAgICAgICAgICAgICAgICAgIGMxOiBbYnggKyBidywgYnldLAogICAgICAgICAgICAgICAgICAgICAgICBjMjogW2J4ICsgYncsIGJ5ICsgYmggKyBib3JkZXJzWzJdLndpZHRoXSwKICAgICAgICAgICAgICAgICAgICAgICAgYzM6IFtieCwgYnkgKyBiaF0sCiAgICAgICAgICAgICAgICAgICAgICAgIGM0OiBbYngsIGJ5ICsgYm9yZGVyc1swXS53aWR0aF0KICAgICAgICAgICAgICAgICAgICB9LCByYWRpdXNbMV0sIHJhZGl1c1syXSwKICAgICAgICAgICAgICAgICAgICBib3JkZXJQb2ludHMudG9wUmlnaHRPdXRlciwgYm9yZGVyUG9pbnRzLnRvcFJpZ2h0SW5uZXIsIGJvcmRlclBvaW50cy5ib3R0b21SaWdodE91dGVyLCBib3JkZXJQb2ludHMuYm90dG9tUmlnaHRJbm5lcik7CiAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgY2FzZSAyOgogICAgICAgICAgICAgICAgLy8gYm90dG9tIGJvcmRlcgogICAgICAgICAgICAgICAgYnkgPSAoYnkgKyBub2RlQm91bmRzLmhlaWdodCkgLSAoYm9yZGVyc1syXS53aWR0aCk7CiAgICAgICAgICAgICAgICBiaCA9IGJvcmRlcnNbMl0ud2lkdGg7CiAgICAgICAgICAgICAgICBib3JkZXIuYXJncyA9IGRyYXdTaWRlKHsKICAgICAgICAgICAgICAgICAgICAgICAgYzE6IFtieCArIGJ3LCBieSArIGJoXSwKICAgICAgICAgICAgICAgICAgICAgICAgYzI6IFtieCwgYnkgKyBiaF0sCiAgICAgICAgICAgICAgICAgICAgICAgIGMzOiBbYnggKyBib3JkZXJzWzNdLndpZHRoLCBieV0sCiAgICAgICAgICAgICAgICAgICAgICAgIGM0OiBbYnggKyBidyAtIGJvcmRlcnNbM10ud2lkdGgsIGJ5XQogICAgICAgICAgICAgICAgICAgIH0sIHJhZGl1c1syXSwgcmFkaXVzWzNdLAogICAgICAgICAgICAgICAgICAgIGJvcmRlclBvaW50cy5ib3R0b21SaWdodE91dGVyLCBib3JkZXJQb2ludHMuYm90dG9tUmlnaHRJbm5lciwgYm9yZGVyUG9pbnRzLmJvdHRvbUxlZnRPdXRlciwgYm9yZGVyUG9pbnRzLmJvdHRvbUxlZnRJbm5lcik7CiAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgY2FzZSAzOgogICAgICAgICAgICAgICAgLy8gbGVmdCBib3JkZXIKICAgICAgICAgICAgICAgIGJ3ID0gYm9yZGVyc1szXS53aWR0aDsKICAgICAgICAgICAgICAgIGJvcmRlci5hcmdzID0gZHJhd1NpZGUoewogICAgICAgICAgICAgICAgICAgICAgICBjMTogW2J4LCBieSArIGJoICsgYm9yZGVyc1syXS53aWR0aF0sCiAgICAgICAgICAgICAgICAgICAgICAgIGMyOiBbYngsIGJ5XSwKICAgICAgICAgICAgICAgICAgICAgICAgYzM6IFtieCArIGJ3LCBieSArIGJvcmRlcnNbMF0ud2lkdGhdLAogICAgICAgICAgICAgICAgICAgICAgICBjNDogW2J4ICsgYncsIGJ5ICsgYmhdCiAgICAgICAgICAgICAgICAgICAgfSwgcmFkaXVzWzNdLCByYWRpdXNbMF0sCiAgICAgICAgICAgICAgICAgICAgYm9yZGVyUG9pbnRzLmJvdHRvbUxlZnRPdXRlciwgYm9yZGVyUG9pbnRzLmJvdHRvbUxlZnRJbm5lciwgYm9yZGVyUG9pbnRzLnRvcExlZnRPdXRlciwgYm9yZGVyUG9pbnRzLnRvcExlZnRJbm5lcik7CiAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICByZXR1cm4gYm9yZGVyOwogICAgfSk7Cn0KCk5vZGVQYXJzZXIucHJvdG90eXBlLnBhcnNlQmFja2dyb3VuZENsaXAgPSBmdW5jdGlvbihjb250YWluZXIsIGJvcmRlclBvaW50cywgYm9yZGVycywgcmFkaXVzLCBib3VuZHMpIHsKICAgIHZhciBiYWNrZ3JvdW5kQ2xpcCA9IGNvbnRhaW5lci5jc3MoJ2JhY2tncm91bmRDbGlwJyksCiAgICAgICAgYm9yZGVyQXJncyA9IFtdOwoKICAgIHN3aXRjaChiYWNrZ3JvdW5kQ2xpcCkgewogICAgY2FzZSAiY29udGVudC1ib3giOgogICAgY2FzZSAicGFkZGluZy1ib3giOgogICAgICAgIHBhcnNlQ29ybmVyKGJvcmRlckFyZ3MsIHJhZGl1c1swXSwgcmFkaXVzWzFdLCBib3JkZXJQb2ludHMudG9wTGVmdElubmVyLCBib3JkZXJQb2ludHMudG9wUmlnaHRJbm5lciwgYm91bmRzLmxlZnQgKyBib3JkZXJzWzNdLndpZHRoLCBib3VuZHMudG9wICsgYm9yZGVyc1swXS53aWR0aCk7CiAgICAgICAgcGFyc2VDb3JuZXIoYm9yZGVyQXJncywgcmFkaXVzWzFdLCByYWRpdXNbMl0sIGJvcmRlclBvaW50cy50b3BSaWdodElubmVyLCBib3JkZXJQb2ludHMuYm90dG9tUm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SBmdW5jdGlvbiAoYSwgYiwgdCkgewogICAgICAgIHJldHVybiB7CiAgICAgICAgICAgIHg6IGEueCArIChiLnggLSBhLngpICogdCwKICAgICAgICAgICAgeTogYS55ICsgKGIueSAtIGEueSkgKiB0CiAgICAgICAgfTsKICAgIH07CgogICAgcmV0dXJuIHsKICAgICAgICBzdGFydDogc3RhcnQsCiAgICAgICAgc3RhcnRDb250cm9sOiBzdGFydENvbnRyb2wsCiAgICAgICAgZW5kQ29udHJvbDogZW5kQ29udHJvbCwKICAgICAgICBlbmQ6IGVuZCwKICAgICAgICBzdWJkaXZpZGU6IGZ1bmN0aW9uKHQpIHsKICAgICAgICAgICAgdmFyIGFiID0gbGVycChzdGFydCwgc3RhcnRDb250cm9sLCB0KSwKICAgICAgICAgICAgICAgIGJjID0gbGVycChzdGFydENvbnRyb2wsIGVuZENvbnRyb2wsIHQpLAogICAgICAgICAgICAgICAgY2QgPSBsZXJwKGVuZENvbnRyb2wsIGVuZCwgdCksCiAgICAgICAgICAgICAgICBhYmJjID0gbGVycChhYiwgYmMsIHQpLAogICAgICAgICAgICAgICAgYmNjZCA9IGxlcnAoYmMsIGNkLCB0KSwKICAgICAgICAgICAgICAgIGRlc3QgPSBsZXJwKGFiYmMsIGJjY2QsIHQpOwogICAgICAgICAgICByZXR1cm4gW2JlemllckN1cnZlKHN0YXJ0LCBhYiwgYWJiYywgZGVzdCksIGJlemllckN1cnZlKGRlc3QsIGJjY2QsIGNkLCBlbmQpXTsKICAgICAgICB9LAogICAgICAgIGN1cnZlVG86IGZ1bmN0aW9uKGJvcmRlckFyZ3MpIHsKICAgICAgICAgICAgYm9yZGVyQXJncy5wdXNoKFsiYmV6aWVyQ3VydmUiLCBzdGFydENvbnRyb2wueCwgc3RhcnRDb250cm9sLnksIGVuZENvbnRyb2wueCwgZW5kQ29udHJvbC55LCBlbmQueCwgZW5kLnldKTsKICAgICAgICB9LAogICAgICAgIGN1cnZlVG9SZXZlcnNlZDogZnVuY3Rpb24oYm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AiaHRtbDJjYW52YXNfIiArIERhdGUubm93KCkgKyAiXyIgKyAoKytwcm94eUNvdW50KSArICJfIiArIE1hdGgucm91bmQoTWF0aC5yYW5kb20oKSAqIDEwMDAwMCkgOiAiIjsKfQoKZnVuY3Rpb24gY3JlYXRlUHJveHlVcmwocHJveHlVcmwsIHNyYywgY2FsbGJhY2spIHsKICAgIHJldHVybiBwcm94eVVybCArICI/dXJsPSIgKyBlbmNvZGVVUklDb21wb25lbnQoc3JjKSArIChjYWxsYmFjay5sZW5ndGggPyAiJmNhbGxiYWNrPWh0bWwyY2FudmFzLnByb3h5LiIgKyBjYWxsYmFjayA6ICIiKTsKfQoKZnVuY3Rpb24gZG9jdW1lbnRGcm9tSFRNTChzcmMpIHsKICAgIHJldHVybiBmdW5jdGlvbihodG1sKSB7CiAgICAgICAgdmFyIHBhcnNlciA9IG5ldyBET01QYXJzZXIoKSwgZG9jOwogICAgICAgIHRyeSB7CiAgICAgICAgICAgIGRvYyA9IHBhcnNlci5wYXJzZUZyb21TdHJpbmcoaHRtbCwgInRleHQvaHRtbCIpOwogICAgICAgIH0gY2F0Y2goZSkgewogICAgICAgICAgICBsb2coIkRPTVBhcnNlciBub3Qgc3VwcG9ydGVkLCBmYWxsaW5nIGJhY2sgdG8gY3JlYXRlSFRNTERvY3VtZW50Iik7CiAgICAgICAgICAgIGRvYyA9IGRvY3VtZW50LmltcGxlbWVudGF0aW9uLmNyZWF0ZUhUTUxEb2N1bWVudCgiIik7CiAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICBkb2Mub3BlbigpOwogICAgICAgICAgICAgICAgZG9jLndyaXRlKGh0bWwpOwogICAgICAgICAgICAgICAgZG9jLmNsb3NlKCk7CiAgICAgICAgICAgIH0gY2F0Y2goZWUpIHsKICAgICAgICAgICAgICAgIGxvZygiY3JlYXRlSFRNTERvY3VtZW50IHdyaXRlIG5vdCBzdXBwb3J0ZWQsIGZhbGxpbmcgYmFjayB0byBkb2N1bWVudC5ib2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bmVyLnBhcnNlQmFja2dyb3VuZEltYWdlcygpOwogICAgYmFja2dyb3VuZEltYWdlcy5yZXZlcnNlKCkuZm9yRWFjaChmdW5jdGlvbihiYWNrZ3JvdW5kSW1hZ2UsIGluZGV4LCBhcnIpIHsKICAgICAgICBzd2l0Y2goYmFja2dyb3VuZEltYWdlLm1ldGhvZCkgewogICAgICAgIGNhc2UgInVybCI6CiAgICAgICAgICAgIHZhciBpbWFnZSA9IHRoaXMuaW1hZ2VzLmdldChiYWNrZ3JvdW5kSW1hZ2UuYXJnc1swXSk7CiAgICAgICAgICAgIGlmIChpbWFnZSkgewogICAgICAgICAgICAgICAgdGhpcy5yZW5kZXJCYWNrZ3JvdW5kUmVwZWF0aW5nKGNvbnRhaW5lciwgYm91bmRzLCBpbWFnZSwgYXJyLmxlbmd0aCAtIChpbmRleCsxKSwgYm9yZGVyRGF0YSk7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBsb2coIkVycm9yIGxvYWRpbmcgYmFja2dyb3VuZC1pbWFnZSIsIGJhY2tncm91bmRJbWFnZS5hcmdzWzBdKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBicmVhazsKICAgICAgICBjYXNlICJsaW5lYXItZ3JhZGllbnQiOgogICAgICAgIGNhc2UgImdyYWRpZW50IjoKICAgICAgICAgICAgdmFyIGdyYWRpZW50SW1hZ2UgPSB0aGlzLmltYWdlcy5nZXQoYmFja2dyb3VuZEltYWdlLnZhbHVlKTsKICAgICAgICAgICAgaWYgKGdyYWRpZW50SW1hZ2UpIHsKICAgICAgICAgICAgICAgIHRoaXMucmVuZGVyQmFja2dyb3VuZEdyYWRpZW50KGdyYWRpZW50SW1hZ2UsIGJvdW5kcywgYm9yZGVyRGF0YSk7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBsb2coIkVycm9yIGxvYWRpbmcgYmFja2dyb3VuZC1pbWFnZSIsIGJhY2tncm91bmRJbWFnZS5hcmdzWzBd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odDogbm9kZS5vZmZzZXRMZWZ0ICsgcGFyZW50LmxlZnQgKyBub2RlLm9mZnNldFdpZHRoLAogICAgICAgIGxlZnQ6IG5vZGUub2Zmc2V0TGVmdCArIHBhcmVudC5sZWZ0LAogICAgICAgIHdpZHRoOiBub2RlLm9mZnNldFdpZHRoLAogICAgICAgIGhlaWdodDogbm9kZS5vZmZzZXRIZWlnaHQKICAgIH07Cn07CgpleHBvcnRzLnBhcnNlQmFja2dyb3VuZHMgPSBmdW5jdGlvbihiYWNrZ3JvdW5kSW1hZ2UpIHsKICAgIHZhciB3aGl0ZXNwYWNlID0gJyBcclxuXHQnLAogICAgICAgIG1ldGhvZCwgZGVmaW5pdGlvbiwgcHJlZml4LCBwcmVmaXhfaSwgYmxvY2ssIHJlc3VsdHMgPSBbXSwKICAgICAgICBtb2RlID0gMCwgbnVtUGFyZW4gPSAwLCBxdW90ZSwgYXJnczsKICAgIHZhciBhcHBlbmRSZXN1bHQgPSBmdW5jdGlvbigpIHsKICAgICAgICBpZihtZXRob2QpIHsKICAgICAgICAgICAgaWYgKGRlZmluaXRpb24uc3Vic3RyKDAsIDEpID09PSAnIicpIHsKICAgICAgICAgICAgICAgIGRlZmluaXRpb24gPSBkZWZpbml0aW9uLnN1YnN0cigxLCBkZWZpbml0aW9uLmxlbmd0aCAtIDIpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGlmIChkZWZpbml0aW9uKSB7CiAgICAgICAgICAgICAgICBhcmdzLnB1c2goZGVmaW5pdGlvbik7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKG1ldGhvZC5zdWJzdHIoMCwgMSkgPT09ICctJyAmJiAocHJlZml4X2kgPSBtZXRob2QuaW5kZXhPZignLScsIDEgKSArIDEpID4gMCkgewogICAgICAgICAgICAgICAgcHJlZml4ID0gbWV0aG9kLnN1YnN0cigwLCBwcmVmaXhfaSk7CiAgICAgICAgICAgICAgICBtZXRob2QgPSBtZXRob2Quc3Vic3RyKHByZWZpeF9pKTsKICAgICAgICAgICAgfQogICAgICAgICAgICByZXN1bHRzLnB1c2goewogICAgICAgICAgICAgICAgcHJlZml4OiBwcmVmaXgsCiAgICAgICAgICAgICAgICBtZXRob2Q6IG1ldGhvZC50b0xvd2VyQ2FzZSgpLAogICAgICAgICAgICAgICAgdmFsdWU6IGJsb2NrLAogICAgICAgICAgICAgICAgYXJnczogYXJncywKICAgICAgICAgICAgICAgIGltYWdlOiBudWxsCiAgICAgICAgICAgIH0pOwogICAgICAgIH0KICAgICAgICBhcmdzID0gW107CiAgICAgICAgbWV0aG9kID0gcHJlZml4ID0gZGVmaW5pdGlvbiA9IGJsb2NrID0gJyc7CiAgICB9OwogICAgYXJncyA9IFtdOwogICAgbWV0aG9kID0gcHJlZml4ID0gZGVmaW5pdGlvbiA9IGJsb2NrID0gJyc7CiAgICBiYWNrZ3JvdW5kSW1hZ2Uuc3BsaXQoIiIpLmZvckVhY2goZnVuY3Rpb24oYykgewogICAgICAgIGlmIChtb2RlID09PSAwICYmIHdoaXRlc3BhY2UuaW5kZXhPZihjKSA+IC0xKSB7CiAgICAgICAgICAgIHJldHVybjsKICAgICAgICB9CiAgICAgICAgc3dpdGNoKGMpIHsKICAgICAgICBjYXNlICciJzoKICAgICAgICAgICAgaWYoIXF1b3RlKSB7CiAgICAgICAgICAgICAgICBxdW90ZSA9IGM7CiAgICAgICAgICAgIH0gZWxzZSBpZihxdW90ZSA9PT0gYykgewogICAgICAgICAgICAgICAgcXVvdGUgPSBudWxsOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgIGNhc2UgJygnOgogICAgICAgICAgICBpZihxdW90ZSkgewogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIH0gZWxzZSBpZihtb2RlID09PSAwKSB7CiAgICAgICAgICAgICAgICBtb2RlID0gMTsKICAgICAgICAgICAgICAgIGJsb2NrICs9IGM7CiAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBudW1QYXJlbisrOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgIGNhc2UgJyknOgogICAgICAgICAgICBpZiAocXVvdGUpIHsKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICB9IGVsc2UgaWYobW9kZSA9PT0gMSkgewogICAgICAgICAgICAgICAgaWYobnVtUGFyZW4gPT09IDApIHsKICAgICAgICAgICAgICAgICAgICBtb2RlID0gMDsKICAgICAgICAgICAgICAgICAgICBibG9jayArPSBjOwogICAgICAgICAgICAgICAgICAgIGFwcGVuZFJlc3VsdCgpOwogICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgbnVtUGFyZW4tLTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICBicmVhazsKCiAgICAgICAgY2FzZSAnLCc6CiAgICAgICAgICAgIGlmIChxdW90ZSkgewogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIH0gZWxzZSBpZihtb2RlID09PSAwKSB7CiAgICAgICAgICAgICAgICBhcHBlbmRSZXN1bHQoKTsKICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgfSBlbHNlIGlmIChtb2RlID09PSAxKSB7CiAgICAgICAgICAgICAgICBpZiAobnVtUGFyZW4gPT09IDAgJiYgIW1ldGhvZC5tYXRjaCgvXnVybCQvaSkpIHsKICAgICAgICAgICAgICAgICAgICBhcmdzLnB1c2goZGVmaW5pdGlvbik7CiAgICAgICAgICAgICAgICAgICAgZGVmaW5pdGlvbiA9ICcnOwogICAgICAgICAgICAgICAgICAgIGJsb2NrICs9IGM7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgIH0KCiAgICAgICAgYmxvY2sgKz0gYzs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RhdGEgPSBkYXRhOwogICAgICB0aGlzLnBvcyA9IDg7CiAgICAgIHRoaXMucGFsZXR0ZSA9IFtdOwogICAgICB0aGlzLmltZ0RhdGEgPSBbXTsKICAgICAgdGhpcy50cmFuc3BhcmVuY3kgPSB7fTsKICAgICAgdGhpcy5hbmltYXRpb24gPSBudWxsOwogICAgICB0aGlzLnRleHQgPSB7fTsKICAgICAgZnJhbWUgPSBudWxsOwogICAgICB3aGlsZSAodHJ1ZSkgewogICAgICAgIGNodW5rU2l6ZSA9IHRoaXMucmVhZFVJbnQzMigpOwogICAgICAgIHNlY3Rpb24gPSAoKGZ1bmN0aW9uKCkgewogICAgICAgICAgdmFyIF9pLCBfcmVzdWx0czsKICAgICAgICAgIF9yZXN1bHRzID0gW107CiAgICAgICAgICBmb3IgKGkgPSBfaSA9IDA7IF9pIDwgNDsgaSA9ICsrX2kpIHsKICAgICAgICAgICAgX3Jlc3VsdHMucHVzaChTdHJpbmcuZnJvbUNoYXJDb2RlKHRoaXMuZGF0YVt0aGlzLnBvcysrXSkpOwogICAgICAgICAgfQogICAgICAgICAgcmV0dXJuIF9yZXN1bHRzOwogICAgICAgIH0pLmNhbGwodGhpcykpLmpvaW4oJycpOwogICAgICAgIHN3aXRjaCAoc2VjdGlvbikgewogICAgICAgICAgY2FzZSAnSUhEUic6CiAgICAgICAgICAgIHRoaXMud2lkdGggPSB0aGlzLnJlYWRVSW50MzIoKTsKICAgICAgICAgICAgdGhpcy5oZWlnaHQgPSB0aGlzLnJlYWRVSW50MzIoKTsKICAgICAgICAgICAgdGhpcy5iaXRzID0gdGhpcy5kYXRhW3RoaXMucG9zKytdOwogICAgICAgICAgICB0aGlzLmNvbG9yVHlwZSA9IHRoaXMuZGF0YVt0aGlzLnBvcysrXTsKICAgICAgICAgICAgdGhpcy5jb21wcmVzc2lvbk1ldGhvZCA9IHRoaXMuZGF0YVt0aGlzLnBvcysrXTsKICAgICAgICAgICAgdGhpcy5maWx0ZXJNZXRob2QgPSB0aGlzLmRhdGFbdGhpcy5wb3MrK107CiAgICAgICAgICAgIHRoaXMuaW50ZXJsYWNlTWV0aG9kID0gdGhpcy5kYXRhW3RoaXMucG9zKytdOwogICAgICAgICAgICBicmVhazsKICAgICAgICAgIGNhc2UgJ2FjVEwnOgogICAgICAgICAgICB0aGlzLmFuaW1hdGlvbiA9IHsKICAgICAgICAgICAgICBudW1GcmFtZXM6IHRoaXMucmVhZFVJbnQzMigpLAogICAgICAgICAgICAgIG51bVBsYXlzOiB0aGlzLnJlYWRVSW50MzIoKSB8fCBJbmZpbml0eSwKICAgICAgICAgICAgICBmcmFtZXM6IFtdCiAgICAgICAgICAgIH07CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgY2FzZSAnUExURSc6CiAgICAgICAgICAgIHRoaXMucGFsZXR0ZSA9IHRoaXMucmVhZChjaHVua1NpemUpOwogICAgICAgICAgICBicmVhazsKICAgICAgICAgIGNhc2UgJ2ZjVEwnOgogICAgICAgICAgICBpZiAoZnJhbWUpIHsKICAgICAgICAgICAgICB0aGlzLmFuaW1hdGlvbi5mcmFtZXMucHVzaChmcmFtZSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgdGhpcy5wb3MgKz0gNDsKICAgICAgICAgICAgZnJhbWUgPSB7CiAgICAgICAgICAgICAgd2lkdGg6IHRoaXMucmVhZFVJbnQzMigpLAogICAgICAgICAgICAgIGhlaWdodDogdGhpcy5yZWFkVUludDMyKCksCiAgICAgICAgICAgICAgeE9mZnNldDogdGhpcy5yZWFkVUludDMyKCksCiAgICAgICAgICAgICAgeU9mZnNldDogdGhpcy5yZWFkVUludDMyKCkKICAgICAgICAgICAgfTsKICAgICAgICAgICAgZGVsYXlOdW0gPSB0aGlzLnJlYWRVSW50MTYoKTsKICAgICAgICAgICAgZGVsYXlEZW4gPSB0aGlzLnJlYWRVSW50MTYoKSB8fCAxMDA7CiAgICAgICAgICAgIGZyYW1lLmRlbGF5ID0gMTAwMCAqIGRlbGF5TnVtIC8gZGVsYXlEZW47CiAgICAgICAgICAgIGZyYW1lLmRpc3Bvc2VPcCA9IHRoaXMuZGF0YVt0aGlzLnBvcysrXTsKICAgICAgICAgICAgZnJhbWUuYmxlbmRPcCA9IHRoaXMuZGF0YVt0aGlzLnBvcysrXTsKICAgICAgICAgICAgZnJhbWUuZGF0YSA9IFtdOwogICAgICAgICAgICBicmVhazsKICAgICAgICAgIGNhc2UgJ0lEQVQnOgogICAgICAgICAgY2FzZSAnZmRBVCc6CiAgICAgICAgICAgIGlmIChzZWN0aW9uID09PSAnZmRBVCcpIHsKICAgICAgICAgICAgICB0aGlzLnBvcyArPSA0OwogICAgICAgICAgICAgIGNodW5rU2l6ZSAtPSA0OwogICAgICAgICAgICB9CiAgICAgICAgICAgIGRhdGEgPSAoZnJhbWUgIT0gbnVsbCA/IGZyYW1lLmRhdGEgOiB2b2lkIDApIHx8IHRoaXMuaW1nRGF0YTsKICAgICAgICAgICAgZm9yIChpID0gX2kgPSAwOyAwIDw9IGNodW5rU2l6ZSA/IF9pIDwgY2h1bmtTaXplIDogX2kgPiBjaHVua1NpemU7IGkgPSAwIDw9IGNodW5rU2l6ZSA/ICsrX2kgOiAtLV9pKSB7CiAgICAgICAgICAgICAgZGF0YS5wdXNoKHRoaXMuZGF0YVt0aGlzLnBvcysrXSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICBjYXNlICd0Uk5TJzoKICAgICAgICAgICAgdGhpcy50cmFuc3BhcmVuY3kgPSB7fTsKICAgICAgICAgICAgc3dpdGNoICh0aGlzLmNvbG9yVHlwZSkgewogICAgICAgICAgICAgIGNhc2UgMzoKICAgICAgICAgICAgCXBhbExlbiA9IHRoaXMucGFsZXR0ZS5sZW5ndGgvMzsKICAgICAgICAgICAgICAgIHRoaXMudHJhbnNwYXJlbmN5LmluZGV4ZWQgPSB0aGlzLnJlYWQoY2h1bmtTaXplKTsKICAgICAgICAgICAgICAgIGlmKHRoaXMudHJhbnNwYXJlbmN5LmluZGV4ZWQubGVuZ3RoID4gcGFsTGVuKQogICAgICAgICAgICAgICAgCXRocm93IG5ldyBFcnJvcignTW9yZSB0cmFuc3BhcmVudCBjb2xvcnMgdGhhbiBwYWxldHRlIHNpemUnKTsKICAgICAgICAgICAgICAgIC8qCiAgICAgICAgICAgICAgICAgKiBBY2NvcmRpbmcgdG8gdGhlIFBORyBzcGVjIHRybnMgc2hvdWxkIGJlIGluY3JlYXNlZCB0byB0aGUgc2FtZSBzaXplIGFzIHBhbGV0dGUgaWYgc2hvcnRlcgogICAgICAgICAgICAgICAgICovCiAgICAgICAgICAgICAgICAvL3BhbFNob3J0ID0gMjU1IC0gdGhpcy50cmFuc3BhcmVuY3kuaW5kZXhlZC5sZW5ndGg7CiAgICAgICAgICAgICAgICBwYWxTaG9ydCA9IHBhbExlbiAtIHRoaXMudHJhbnNwYXJlbmN5LmluZGV4ZWQubGVuZ3RoOwogICAgICAgICAgICAgICAgaWYgKHBhbFNob3J0ID4gMCkgewogICAgICAgICAgICAgICAgICBmb3IgKGkgPSBfaiA9IDA7IDAgPD0gcGFsU2hvcnQgPyBfaiA8IHBhbFNob3J0IDogX2ogPiBwYWxTaG9ydDsgaSA9IDAgPD0gcGFsU2hvcnQgPyArK19qIDogLS1faikgewogICAgICAgICAgICAgICAgICAgIHRoaXMudHJhbnNwYXJlbmN5LmluZGV4ZWQucHVzaCgyNTUpOwogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICBjYXNlIDA6CiAgICAgICAgICAgICAgICB0aGlzLnRyYW5zcGFyZW5jeS5ncmF5c2NhbGUgPSB0aGlzLnJlYWQoY2h1bmtTaXplKVswXTsKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgIGNhc2UgMjoKICAgICAgICAgICAgICAgIHRoaXMudHJhbnNwYXJlbmN5LnJnYiA9IHRoaXMucmVhZChjaHVua1NpemUpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgY2FzZSAndEVYdCc6CiAgICAgICAgICAgIHRleHQgPSB0aGlzLnJlYWQoY2h1bmtTaXplKTsKICAgICAgICAgICAgaW5kZXggPSB0ZXh0LmluZGV4T2YoMCk7CiAgICAgICAgICAgIGtleSA9IFN0cmluZy5mcm9tQ2hhckNvZGUuYXBwbHkoU3RyaW5nLCB0ZXh0LnNsaWNlKDAsIGluZGV4KSk7CiAgICAgICAgICAgIHRoaXMudGV4dFtrZXldID0gU3RyaW5nLmZyb21DaGFyQ29kZS5hcHBseShTdHJpbmcsIHRleHQuc2xpY2UoaW5kZXggKyAxKSk7CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgY2FzZSAnSUVORCc6CiAgICAgICAgICAgIGlmIChmcmFtZSkgewogICAgICAgICAgICAgIHRoaXMuYW5pbWF0aW9uLmZyYW1lcy5wdXNoKGZyYW1lKTsKICAgICAgICAgICAgfQogICAgICAgICAgICB0aGlzLmNvbG9ycyA9IChmdW5jdGlvbigpIHsKICAgICAgICAgICAgICBzd2l0Y2ggKHRoaXMuY29sb3JUeXBlKSB7CiAgICAgICAgICAgICAgICBjYXNlIDA6CiAgICAgICAgICAgICAgICBjYXNlIDM6CiAgICAgICAgICAgICAgICBjYXNlIDQ6CiAgICAgICAgICAgICAgICAgIHJldHVybiAxOwogICAgICAgICAgICAgICAgY2FzZSAyOgogICAgICAgICAgICAgICAgY2FzZSA2OgogICAgICAgICAgICAgICAgICByZXR1cm4gMzsKICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0pLmNhbGwodGhpcyk7CiAgICAgICAgICAgIHRoaXMuaGFzQWxwaGFDaGFubmVsID0gKF9yZWYgPSB0aGlzLmNvbG9yVHlwZSkgPT09IDQgfHwgX3JlZiA9PT0gNjsKICAgICAgICAgICAgY29sb3JzID0gdGhpcy5jb2xvcnMgKyAodGhpcy5oYXNBbHBoYUNoYW5uZWwgPyAxIDogMCk7CiAgICAgICAgICAgIHRoaXMucGl4ZWxCaXRsZW5ndGggPSB0aGlzLmJpdHMgKiBjb2xvcnM7CiAgICAgICAgICAgIHRoaXMuY29sb3JTcGFjZSA9IChmdW5jdGlvbigpIHsKICAgICAgICAgICAgICBzd2l0Y2ggKHRoaXMuY29sb3JzKSB7CiAgICAgICAgICAgICAgICBjYXNlIDE6CiAgICAgICAgICAgICAgICAgIHJldHVybiAnRGV2aWNlR3JheSc7CiAgICAgICAgICAgICAgICBjYXNlIDM6CiAgICAgICAgICAgICAgICAgIHJldHVybiAnRGV2aWNlUkdCJzsKICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0pLmNhbGwodGhpcyk7CiAgICAgICAgICAgIHRoaXMuaW1nRGF0YSA9IG5ldyBVaW50OEFycmF5KHRoaXMuaW1nRGF0YSk7CiAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgIGRlZmF1bHQ6CiAgICAgICAgICAgIHRoaXMucG9zICs9IGNodW5rU2l6ZTsKICAgICAgICB9CiAgICAgICAgdGhpcy5wb3MgKz0gNDsKICAgICAgICBpZiAodGhpcy5wb3MgPiB0aGlzLmRhdGEubGVuZ3RoKSB7CiAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoIkluY29tcGxldGUgb3IgY29ycnVwdCBQTkcgZmlsZSIpOwogICAgICAgIH0KICAgICAgfQogICAgICByZXR1cm47CiAgICB9CgogICAgUE5HLnByb3RvdHlwZS5yZWFkID0gZnVuY3Rpb24oYnl0ZXMpIHsKICAgICAgdmFyIGksIF9pLCBfcmVzdWx0czsKICAgICAgX3Jlc3VsdHMgPSBbXTsKICAgICAgZm9yIChpID0gX2kgPSAwOyAwIDw9IGJ5dGVzID8gX2kgPCBieXRlcyA6IF9pID4gYnl0ZXM7IGkgPSAwIDw9IGJ5dGVzID8gKytfaSA6IC0tX2kpIHsKICAgICAgICBfcmVzdWx0cy5wdXNoKHRoaXMuZGF0YVt0aGlzLnBvcysrXSk7CiAgICAgIH0KICAgICAgcm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gICAgIGRhdGEgPSBkYXRhLmdldEJ5dGVzKCk7CiAgICAgIHBpeGVsQnl0ZXMgPSB0aGlzLnBpeGVsQml0bGVuZ3RoIC8gODsKICAgICAgc2NhbmxpbmVMZW5ndGggPSBwaXhlbEJ5dGVzICogdGhpcy53aWR0aDsKICAgICAgcGl4ZWxzID0gbmV3IFVpbnQ4QXJyYXkoc2NhbmxpbmVMZW5ndGggKiB0aGlzLmhlaWdodCk7CiAgICAgIGxlbmd0aCA9IGRhdGEubGVuZ3RoOwogICAgICByb3cgPSAwOwogICAgICBwb3MgPSAwOwogICAgICBjID0gMDsKICAgICAgd2hpbGUgKHBvcyA8IGxlbmd0aCkgewogICAgICAgIHN3aXRjaCAoZGF0YVtwb3MrK10pIHsKICAgICAgICAgIGNhc2UgMDoKICAgICAgICAgICAgZm9yIChpID0gX2kgPSAwOyBfaSA8IHNjYW5saW5lTGVuZ3RoOyBpID0gX2kgKz0gMSkgewogICAgICAgICAgICAgIHBpeGVsc1tjKytdID0gZGF0YVtwb3MrK107CiAgICAgICAgICAgIH0KICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICBjYXNlIDE6CiAgICAgICAgICAgIGZvciAoaSA9IF9qID0gMDsgX2ogPCBzY2FubGluZUxlbmd0aDsgaSA9IF9qICs9IDEpIHsKICAgICAgICAgICAgICBhYnl0ZSA9IGRhdGFbcG9zKytdOwogICAgICAgICAgICAgIGxlZnQgPSBpIDwgcGl4ZWxCeXRlcyA/IDAgOiBwaXhlbHNbYyAtIHBpeGVsQnl0ZXNdOwogICAgICAgICAgICAgIHBpeGVsc1tjKytdID0gKGFieXRlICsgbGVmdCkgJSAyNTY7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICBjYXNlIDI6CiAgICAgICAgICAgIGZvciAoaSA9IF9rID0gMDsgX2sgPCBzY2FubGluZUxlbmd0aDsgaSA9IF9rICs9IDEpIHsKICAgICAgICAgICAgICBhYnl0ZSA9IGRhdGFbcG9zKytdOwogICAgICAgICAgICAgIGNvbCA9IChpIC0gKGkgJSBwaXhlbEJ5dGVzKSkgLyBwaXhlbEJ5dGVzOwogICAgICAgICAgICAgIHVwcGVyID0gcm93ICYmIHBpeGVsc1socm93IC0gMSkgKiBzY2FubGluZUxlbmd0aCArIGNvbCAqIHBpeGVsQnl0ZXMgKyAoaSAlIHBpeGVsQnl0ZXMpXTsKICAgICAgICAgICAgICBwaXhlbHNbYysrXSA9ICh1cHBlciArIGFieXRlKSAlIDI1NjsKICAgICAgICAgICAgfQogICAgICAgICAgICBicmVhazsKICAgICAgICAgIGNhc2UgMzoKICAgICAgICAgICAgZm9yIChpID0gX2wgPSAwOyBfbCA8IHNjYW5saW5lTGVuZ3RoOyBpID0gX2wgKz0gMSkgewogICAgICAgICAgICAgIGFieXRlID0gZGF0YVtwb3MrK107CiAgICAgICAgICAgICAgY29sID0gKGkgLSAoaSAlIHBpeGVsQnl0ZXMpKSAvIHBpeGVsQnl0ZXM7CiAgICAgICAgICAgICAgbGVmdCA9IGkgPCBwaXhlbEJ5dGVzID8gMCA6IHBpeGVsc1tjIC0gcGl4ZWxCeXRlc107CiAgICAgICAgICAgICAgdXBwZXIgPSByb3cgJiYgcGl4ZWxzWyhyb3cgLSAxKSAqIHNjYW5saW5lTGVuZ3RoICsgY29sICogcGl4ZWxCeXRlcyArIChpICUgcGl4ZWxCeXRlcyldOwogICAgICAgICAgICAgIHBpeGVsc1tjKytdID0gKGFieXRlICsgTWF0aC5mbG9vcigobGVmdCArIHVwcGVyKSAvIDIpKSAlIDI1NjsKICAgICAgICAgICAgfQogICAgICAgICAgICBicmVhazsKICAgICAgICAgIGNhc2UgNDoKICAgICAgICAgICAgZm9yIChpID0gX20gPSAwOyBfbSA8IHNjYW5saW5lTGVuZ3RoOyBpID0gX20gKz0gMSkgewogICAgICAgICAgICAgIGFieXRlID0gZGF0YVtwb3MrK107CiAgICAgICAgICAgICAgY29sID0gKGkgLSAoaSAlIHBpeGVsQnl0ZXMpKSAvIHBpeGVsQnl0ZXM7CiAgICAgICAgICAgICAgbGVmdCA9IGkgPCBwaXhlbEJ5dGVzID8gMCA6IHBpeGVsc1tjIC0gcGl4ZWxCeXRlc107CiAgICAgICAgICAgICAgaWYgKHJvdyA9PT0gMCkgewogICAgICAgICAgICAgICAgdXBwZXIgPSB1cHBlckxlZnQgPSAwOwogICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICB1cHBlciA9IHBpeGVsc1socm93IC0gMSkgKiBzY2FubGluZUxlbmd0aCArIGNvbCAqIHBpeGVsQnl0ZXMgKyAoaSAlIHBpeGVsQnl0ZXMpXTsKICAgICAgICAgICAgICAgIHVwcGVyTGVmdCA9IGNvbCAmJiBwaXhlbHNbKHJvdyAtIDEpICogc2NhbmxpbmVMZW5ndGggKyAoY29sIC0gMSkgKiBwaXhlbEJ5dGVzICsgKGkgJSBwaXhlbEJ5dGVzKV07CiAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIHAgPSBsZWZ0ICsgdXBwZXIgLSB1cHBlckxlZnQ7CiAgICAgICAgICAgICAgcGEgPSBNYXRoLmFicyhwIC0gbGVmdCk7CiAgICAgICAgICAgICAgcGIgPSBNYXRoLmFicyhwIC0gdXBwZXIpOwogICAgICAgICAgICAgIHBjID0gTWF0aC5hYnMocCAtIHVwcGVyTGVmdCk7CiAgICAgICAgICAgICAgaWYgKHBhIDw9IHBiICYmIHBhIDw9IHBjKSB7CiAgICAgICAgICAgICAgICBwYWV0aCA9IGxlZnQ7CiAgICAgICAgICAgICAgfSBlbHNlIGlmIChwYiA8PSBwYykgewogICAgICAgICAgICAgICAgcGFldGggPSB1cHBlcjsKICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgcGFldGggPSB1cHBlckxlZnQ7CiAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIHBpeGVsc1tjKytdID0gKGFieXRlICsgcGFldGgpICUgMjU2OwogICAgICAgICAgICB9CiAgICAgICAgICAg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AgICAgICBfdGhpcyA9IHRoaXM7CiAgICAgIGZyYW1lTnVtYmVyID0gMDsKICAgICAgX3JlZiA9IHRoaXMuYW5pbWF0aW9uLCBudW1GcmFtZXMgPSBfcmVmLm51bUZyYW1lcywgZnJhbWVzID0gX3JlZi5mcmFtZXMsIG51bVBsYXlzID0gX3JlZi5udW1QbGF5czsKICAgICAgcmV0dXJuIChkb0ZyYW1lID0gZnVuY3Rpb24oKSB7CiAgICAgICAgdmFyIGYsIGZyYW1lOwogICAgICAgIGYgPSBmcmFtZU51bWJlcisrICUgbnVtRnJhbWVzOwogICAgICAgIGZyYW1lID0gZnJhbWVzW2ZdOwogICAgICAgIF90aGlzLnJlbmRlckZyYW1lKGN0eCwgZik7CiAgICAgICAgaWYgKG51bUZyYW1lcyA+IDEgJiYgZnJhbWVOdW1iZXIgLyBudW1GcmFtZXMgPCBudW1QbGF5cykgewogICAgICAgICAgcmV0dXJuIF90aGlzLmFuaW1hdGlvbi5fdGltZW91dCA9IHNldFRpbWVvdXQoZG9GcmFtZSwgZnJhbWUuZGVsYXkpOwogICAgICAgIH0KICAgICAgfSkoKTsKICAgIH07CgogICAgUE5HLnByb3RvdHlwZS5zdG9wQW5pbWF0aW9uID0gZnVuY3Rpb24oKSB7CiAgICAgIHZhciBfcmVmOwogICAgICByZXR1cm4gY2xlYXJUaW1lb3V0KChfcmVmID0gdGhpcy5hbmltYXRpb24pICE9IG51bGwgPyBfcmVmLl90aW1lb3V0IDogdm9pZCAwKTsKICAgIH07CgogICAgUE5HLnByb3RvdHlwZS5yZW5kZXIgPSBmdW5jdGlvbihjYW52YXMpIHsKICAgICAgdmFyIGN0eCwgZGF0YTsKICAgICAgaWYgKGNhbnZhcy5fcG5nKSB7CiAgICAgICAgY2FudmFzLl9wbmcuc3RvcEFuaW1hdGlvbigpOwogICAgICB9CiAgICAgIGNhbnZhcy5fcG5nID0gdGhpczsKICAgICAgY2FudmFzLndpZHRoID0gdGhpcy53aWR0aDsKICAgICAgY2Fudm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xlbmd0aDsKICAgIHdoaWxlICh0cnVlKSB7CiAgICAgIHZhciBjb2RlMSA9IHRoaXMuZ2V0Q29kZShsaXRDb2RlVGFibGUpOwogICAgICBpZiAoY29kZTEgPCAyNTYpIHsKICAgICAgICBpZiAocG9zICsgMSA+PSBsaW1pdCkgewogICAgICAgICAgYnVmZmVyID0gdGhpcy5lbnN1cmVCdWZmZXIocG9zICsgMSk7CiAgICAgICAgICBsaW1pdCA9IGJ1ZmZlci5sZW5ndGg7CiAgICAgICAgfQogICAgICAgIGJ1ZmZlcltwb3MrK10gPSBjb2RlMTsKICAgICAgICBjb250aW51ZTsKICAgICAgfQogICAgICBpZiAoY29kZTEgPT0gMjU2KSB7CiAgICAgICAgdGhpcy5idWZmZXJMZW5ndGggPSBwb3M7CiAgICAgICAgcmV0dXJuOwogICAgICB9CiAgICAgIGNvZGUxIC09IDI1NzsKICAgICAgY29kZTEgPSBsZW5ndGhEZWNvZGVbY29kZTFdOwogICAgICB2YXIgY29kZTIgPSBjb2RlMSA+PiAxNjsKICAgICAgaWYgKGNvZGUyID4gMCkKICAgICAgICBjb2RlMiA9IHRoaXMuZ2V0Qml0cyhjb2RlMik7CiAgICAgIHZhciBsZW4gPSAoY29kZTEgJiAweGZmZmYpICsgY29kZTI7CiAgICAgIGNvZGUxID0gdGhpcy5nZXRDb2RlKGRpc3RDb2RlVGFibGUpOwogICAgICBjb2RlMSA9IGRpc3REZWNvZGVbY29kZTFdOwogICAgICBjb2RlMiA9IGNvZGUxID4+IDE2OwogICAgICBpZiAoY29kZTIgPiAwKQogICAgICAgIGNvZGUyID0gdGhpcy5nZXRCaXRzKGNvZGUyKTsKICAgICAgdmFyIGRpc3QgPSAoY29kZTEgJiAweGZmZmYpICsgY29kZTI7CiAgICAgIGlmIChwb3MgKyBsZW4gPj0gbGltaXQpIHsKICAgICAgICBidWZmZXIgPSB0aGlzLmVuc3VyZUJ1ZmZlcihwb3MgKyBsZW4pOwogICAgICAgIGxpbWl0ID0gYnVm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HNlbGYgIT09ICJ1bmRlZmluZWQiICYmIHNlbGYgfHwgdHlwZW9mIHdpbmRvdyAhPT0gInVuZGVmaW5lZCIgJiYgd2luZG93IHx8IHVuZGVmaW5lZCk7CgpyZXR1cm4ganNQREY7Cgp9KSkpOwo="></script>
</head>
<body style="background-color: white;">
<div id="htmlwidget_container">
<div id="htmlwidget-e5fc9dbb7ad76ceef3fc" class="visNetwork html-widget" style="width:2000px;height:2000px;">

</div>
</div>
<script type="application/json" data-for="htmlwidget-e5fc9dbb7ad76ceef3fc">{"x":{"nodes":{"id":["interculturality","decoloniality","decolonial pedagogy","vulnerabilities","social determination of health","homeless","health negligence","decolonization","performance","history teaching","eurocentrism","periphery","gender","hip hop","poetry","intersectionality","coloniality","education","literature","linguistic education","social theory","indigenous peoples","curriculum","postcolonialism","colonialism","critical management","patriarchy","state","capital","indigenous women","norms","sexuality","management strategy","south america"],"deg":[31,53,20,10,10,10,10,23,11,10,9,12,39,12,12,19,24,9,8,11,10,10,9,8,10,9,14,14,8,8,8,8,9,9],"size":[2.92452830188679,5,1.88679245283019,0.943396226415094,0.943396226415094,0.943396226415094,0.943396226415094,2.16981132075472,1.0377358490566,0.943396226415094,0.849056603773585,1.13207547169811,3.67924528301887,1.13207547169811,1.13207547169811,1.79245283018868,2.26415094339623,0.849056603773585,0.754716981132075,1.0377358490566,0.943396226415094,0.943396226415094,0.849056603773585,0.754716981132075,0.943396226415094,0.849056603773585,1.32075471698113,1.32075471698113,0.754716981132075,0.754716981132075,0.754716981132075,0.754716981132075,0.849056603773585,0.849056603773585],"font.size":[44.7408324666534,70,29.5002038396427,20,20,20,20,33.8733236404384,20,20,20,20,54.6189543545409,20,20,28.0024633320978,35.2927486269293,20,20,20,20,20,20,20,20,20,20.1872593642622,20.1872593642622,20,20,20,20,20,20],"color":["#E41A1CB3","#E41A1CB3","#E41A1CB3","#E41A1CB3","#E41A1CB3","#E41A1CB3","#E41A1CB3","#E41A1CB3","#E41A1CB3","#E41A1CB3","#E41A1CB3","#E41A1CB3","#E41A1CB3","#E41A1CB3","#E41A1CB3","#E41A1CB3","#E41A1CB3","#E41A1CB3","#E41A1CB3","#E41A1CB3","#E41A1CB3","#E41A1CB3","#E41A1CB3","#E41A1CB3","#E41A1CB3","#E41A1CB3","#E41A1CB3","#E41A1CB3","#E41A1CB3","#E41A1CB3","#E41A1CB3","#E41A1CB3","#E41A1CB3","#E41A1CB3"],"community":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],"labelsize":[10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10],"label":["interculturality","decoloniality","decolonial pedagogy","vulnerabilities","social determination of health","homeless","health negligence","decolonization","performance","history teaching","eurocentrism","periphery","gender","hip hop","poetry","intersectionality","coloniality","education","literature","linguistic education","social theory","indigenous peoples","curriculum","postcolonialism","colonialism","critical management","patriarchy","state","capital","indigenous women","norms","sexuality","management strategy","south america"],"x":[0.319235479091787,-0.0299359367490615,-0.274106894007756,0.580742786110371,0.601367608861243,0.463976980620452,0.715355203647002,-0.676620373426,-0.279151301006054,0.01481143069913,-0.181456393650215,-0.950177538945117,-0.7472635470041,-1,-0.905679394453353,-0.740969879518835,-0.373156504387426,0.244076345232636,0.285832365790154,0.582465519614187,-0.59425110579497,-0.85098007199611,-0.326936545750924,0.00219190704403416,1,0.929051335144522,-0.109045950955769,-0.0541691287560755,-0.0194539529690737,-0.186056093982973,-0.241549597747848,-0.19564116607639,0.892014556838187,0.887968464978139],"y":[-0.682810640471557,-0.763517855103296,-0.490141111954177,0.445372897987012,0.683611270899974,0.579210669930868,0.557002311985497,0.503471072401139,1,-1,-0.958932201014998,0.0842092410725681,0.141542070772674,-0.039208943715483,-0.138567472970789,-0.064645736810239,-0.0889651626859238,-0.840565278366642,0.997980542155029,-0.647096058072864,0.745926411961123,0.421312267194197,-0.845825636507491,0.867239565644982,0.218690744280921,0.0297319428337541,0.0991072396277133,-0.118279860288941,0.00476679101296495,-0.157649852623065,0.0872427967319525,-0.0320630640256577,-0.376411324739688,-0.177888176334655]},"edges":{"from":["interculturality","interculturality","interculturality","decoloniality","decoloniality","decoloniality","decoloniality","decoloniality","decolonial pedagogy","vulnerabilities","vulnerabilities","vulnerabilities","social determination of health","social determination of health","homeless","decolonization","decolonization","decolonization","history teaching","eurocentrism","periphery","periphery","periphery","periphery","gender","gender","gender","gender","gender","hip hop","hip hop","poetry","intersectionality","coloniality","coloniality","coloniality","coloniality","coloniality","coloniality","colonialism","critical management","patriarchy","patriarchy","patriarchy","patriarchy","patriarchy","state","state","state","state","capital","capital","capital","indigenous women","indigenous women","norms","management strategy"],"to":["decoloniality","education","linguistic education","decolonial pedagogy","history teaching","eurocentrism","education","curriculum","coloniality","social determination of health","homeless","health negligence","homeless","health negligence","health negligence","gender","social theory","indigenous peoples","eurocentrism","curriculum","gender","hip hop","poetry","intersectionality","hip hop","poetry","intersectionality","coloniality","indigenous peoples","poetry","intersectionality","intersectionality","coloniality","patriarchy","state","capital","indigenous women","norms","sexuality","critical management","south america","state","capital","indigenous women","norms","sexuality","capital","indigenous women","norms","sexuality","indigenous women","norms","sexuality","norms","sexuality","sexuality","south america"],"color":["#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80","#E41A1C80"],"lty":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],"num":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],"width":[15,5,5,5,5,5,5,10,5,10,10,10,10,10,10,5,5,5,5,5,10,10,10,10,10,10,15,10,5,10,10,10,5,5,5,5,5,5,5,5,5,10,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],"dashes":[false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false]},"nodesToDataframe":true,"edgesToDataframe":true,"options":{"width":"100%","height":"100%","nodes":{"shape":"box","font":{"color":"black"},"scaling":{"label":{"enables":true}},"physics":false},"manipulation":{"enabled":false},"edges":{"smooth":false},"physics":{"enabled":false},"interaction":{"hover":true,"dragNodes":true,"hideEdgesOnDrag":true,"navigationButtons":true}},"groups":null,"width":"2000px","height":"2000px","idselection":{"enabled":true,"style":"width: 150px; height: 26px","useLabels":true,"main":"Select by id"},"byselection":{"enabled":false,"style":"width: 150px; height: 26px","multiple":false,"hideColor":"rgba(200,200,200,0.5)"},"main":null,"submain":null,"footer":null,"background":"rgba(0, 0, 0, 0)","igraphlayout":{"type":"square"},"highlight":{"enabled":true,"hoverNearest":true,"degree":1,"algorithm":"all","hideColor":"rgba(200,200,200,0.5)","labelOnly":true},"collapse":{"enabled":false,"fit":false,"resetHighlight":true,"clusterOptions":null,"keepCoord":true,"labelSuffix":"(cluster)"},"tooltipStay":300,"tooltipStyle":"position: fixed;visibility:hidden;padding: 5px;white-space: nowrap;font-family: verdana;font-size:14px;font-color:#000000;background-color: #f5f4ed;-moz-border-radius: 3px;-webkit-border-radius: 3px;border-radius: 3px;border: 1px solid #808074;box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);","export":{"type":"png","css":"float:right;-webkit-border-radius: 10;\n                  -moz-border-radius: 10;\n                  border-radius: 10px;\n                  font-family: Arial;\n                  color: #ffffff;\n                  font-size: 12px;\n                  background: #090a0a;\n                  padding: 4px 8px 4px 4px;\n                  text-decoration: none;","background":"#fff","name":"network.png","label":"Export as png"}},"evals":[],"jsHooks":[]}</script>
<script type="application/htmlwidget-sizing" data-for="htmlwidget-e5fc9dbb7ad76ceef3fc">{"viewer":{"width":"2000px","height":"2000px","padding":15,"fill":false},"browser":{"width":"2000px","height":"2000px","padding":40,"fill":false}}</script>
</body>
</html>
